Finding an Exact Match within VBA

etemkin56

New Member
Joined
May 12, 2015
Messages
7
Hi All,
I was hoping there would be a way to write a VBA script that is basically a vlookup but needs to be able to be case sensitive.

I have two sheets in my workbook. Sheet 1 has the Account ID and Sheet 2 has Account ID and Names (examples below). I would like to the VBA to look at Sheet 1's account numbers and find the corresponding Names in Sheet 2 to bring over. The catch is, as you can see, some of my account numbers are the same except for the capitalization, which is why i can't use a standard vlookup. Please let me know if someone could help me with writing this VBA. I have tried to use =LOOKUP(9.99999999999999E+307,FIND($D64,'Sheet2'!$A$3:$A$3009),'Sheet2'!$B$3:$B$3009) but when i update I always have random #N/As come up and I don't want to deal with going through them on a monthly basis to figure out why.

Account IDAccount Name
0013600000LeWaJCaroline
0013600000LeWajMike
0013600000LeWaKPat
0013600000LeWakDavid
0013600000LeWaLEmily
0013600000LeWalJeff
0013600000LeWaMKevin
0013600000LeWamGreg
0013600000LeWaNJennifer
0013600000LeWanStephanie
0013600000LeWaOBrad
0013600000LeWao


Thank you in advance for your time!
Tony

<tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Here's a formula method...

=LOOKUP(2,1/EXACT($D64,'Sheet2'!$A$3:$A$3009),'Sheet2'!$B$3:$B$3009)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,691
Members
449,117
Latest member
Aaagu

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