macro compare columns

6toes2

New Member
Joined
Jun 3, 2011
Messages
2
I have a spreadsheet col A Client ID, Col B Blank, Col C Client ID, Col 4 Salesperson ID. I want to match Col A Client ID with Col C Client ID and have the sales person populate in column B that goes with the Column A Client.
I can do the match Micro but it only tells me if there is a match and populates the client id in column B. If someone could lend a hand or point me in the right direction I would really appreciate it. The spreadsheets have about 15000 rows.
Thank you in advance.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I have a spreadsheet col A Client ID, Col B Blank, Col C Client ID, Col 4 Salesperson ID. I want to match Col A Client ID with Col C Client ID and have the sales person populate in column B that goes with the Column A Client.
I can do the match Micro but it only tells me if there is a match and populates the client id in column B. If someone could lend a hand or point me in the right direction I would really appreciate it. The spreadsheets have about 15000 rows.
Thank you in advance.

Maybe Formula in B2 copied down:

=VLOOKUP(A2,$C$2:$D$15000,2,FALSE)

or macro:

Code:
Sub SixToesTwo()

With Range("B2:B15000")

    .Formula = "=VLOOKUP(A2,$C$2:$D$15000,2,FALSE)"
    .Value = Range("B2:B" & lr).Value
    .Replace What:="#N/A", Replacement:="", LookAt:=xlWhole
    
End With

End Sub
 
Upvote 0
Thank you so much I really appreciate it!!
I also came up with =vlookup(a2,sales,2,0) by naming my table it helped tons.
Thanks so much again, if I never posted the question I would never have gotten a answer. Have a great day!!!!
 
Upvote 0
Thank you so much I really appreciate it!!
I also came up with =vlookup(a2,sales,2,0) by naming my table it helped tons.
Thanks so much again, if I never posted the question I would never have gotten a answer. Have a great day!!!!


You're welcome. Glad it helped.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,357
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top