VBA Multi Column Lookup

medberg

New Member
Joined
Jul 29, 2011
Messages
30
Hey Everyone,
I need to write a chunk of code that compares two tables. These were tables pulled from a database so the table rows are indentifiable by a primary key that may or may not be a concatination (sp?) of a few columns. Lets say we have table A and B. Now all of table B is actually in table A. What I need to do is Search through table B record by record and find its cooresponding record in table A. By cooresponding record I mean the record that has the same primary key, which again can be more than one column. Now I could do a simple V lookup, however I don't think this will work because like I said I need to compare multiple columns. Any help would be appreciated. Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I just realized I should clarify a bit. I cannot iterate through the entire second table. It is much too slow considering I will have around 10,000 records minimum. Is there a table index fnuction, for example, that I could use? Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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