Automatic lookup but choosing external files.

Ryan1996

Board Regular
Joined
Jun 4, 2018
Messages
55
Hi Excel members,

Understand the concept of a vlookup and how i can search within another sheet or document however i'd like to automate this. This could be easily done however the files are different each week. I'm sure i can name the files to be the same but need help with the code behind it all.

I have a macro that filters my raw data into columns however i now need to do the lookups.

Essentially the columns look like:
UserID ¦ User number ¦ Name ¦ Vlookup1 ¦ vlookup2...and so on.

The lookups will be along the lines of "=VLOOKUP(A178,'LOCATION AND NAME OF FILE'!$W:$W (This being the column the data is pulled from, this is always the same),1,FALSE)"

How can i create within my macro that says go to vlookup 1 and do a vlookup for A1 (the user ID) against the specified file (i want to choose the file, like a popup menu thing...maybe this is a button? i don't know) and then extend this for all User ID's (A:A) i then want to do the same for Vlookup 2 and so on but with different files.

If anyone can help me with some sort of mock up or code that can help me understand how to do this i would appreciate that.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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