External sheetname variable in VLOOKUP

artaries

New Member
Joined
Jun 9, 2017
Messages
9
Hi

I've googled for hours for a solution on this, but couldn't find anything that seems sustainable.

In a given cell in Workbook 1 I have the following string:

=VLOOKUP($D$2,'[SBE.XLSM]KPI 2017'!$A$9:$AC$20,COLUMN(B$9:B$19),FALSE)

Both filename and sheetname should be a variable based on values of two different cells in Workbook 1 [A6 for Sheetname and A8 for Filename). The whole thing should work, even if the external file is closed.

Anyone?!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try

=VLOOKUP($D$2,INDIRECT("'["&A8&".XLSM]"&A6&"'!$A$9:$AC$20"),COLUMN(B$9:B$19),FALSE)

I dont know if this will work on closed workbooks though.
 
Last edited:
Upvote 0
Try

=VLOOKUP($D$2,INDIRECT("'["&A8&".XLSM]"&A6&"'!$A$9:$AC$20"),COLUMN(B$9:B$19),FALSE)

I dont know if this will work on closed workbooks though.


It doesn't. I already tried that and it works fine with an open workbook, but not otherwise.

An alternative I was thinking about, but don't know if it's possible, would be to use some kind of placeholder for filename and sheetname and upon entering a date in D2 it would trigger a find/replace across the range of cells that include the VLOOKUP. This find/replace could be a button as well.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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