Help to debug VBA code for Excel 2007

5 pts.
Tags:
excel
VBA editor
I’m trying to have Excel look at the contents in Cell E (Account #2) and match it with A,B,C and extract to another sheet. B cell goes to 427,776 rows and E cell goes to 1,406. The end goal is to get the Salesforce ID & Company name lined up with the accounts in Account #2. I’ve got to load the data into SF for Column E with the SF ID. Salesforce will not recognize internal Account ID so the SF ID has to be aligned with the proper company for the accounts in Account #2.

I would greatly appreciate any help that can be offered.

Here is the code

Sub Extract Dups()

Dim RC As Range

Dim Destination As Range

Set RC = Worksheets("Sheet1").Range("C2:C")

Set Destination = Worksheets("Sheet2").Range("A1")

Do Until RC.Value = vbNullString

If StrComp(RC.EntireRow.Cells(2, "C").Text, _

RC.EntireRow.Cells(2, "E").Text, vbTextCompare) = 0 Then

RC.EntireRow.Copy Destination:=Destination

Set Destination = Destination(2, 1)

End If

Set RC = RC(2, 1)

Loop

End Sub

Sample data:

Company SF ID Account # Account # 2 Mag Hotels/Midvale 0017000000ekiOb 5970 3267750 Deve Kennedy 0017000000n1d7n 12864550 1644820 Oglethoe Motel 0017000000kSmr6 12751923 163731 LSU AG CENTER 0017000000jpNT3 5986408 12809900 VOYER AT JUNNIPER RIDGE 0017000000inlbI 6091099 835340 LORI TAELL 0017000000inuJ8 6186657 9602 DESH P PATEL 0017000000inY82 392492 6110176 JP Mague Assoc Inc 0017000000ihWsb 4825348 12686381 Urban Lgue Vilge 0017000000gfC6o 12612948 1182576

Software/Hardware used:
Excel 2007 on Windows Platform

ASKED: October 1, 2012  2:59 PM
UPDATED: October 1, 2012  3:16 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following