Using cell value as filename to return a value from a closed workbook

AndrewMB

Board Regular
Joined
Feb 3, 2008
Messages
75
Good evening everyone,

I have a list of filenames in column A. The list is long. In another column I want a generic formula I can drag down that will return a value from the same cell in each of those files.

Currently, they are written manually like this;

=('P:\FORD BUSINESS UNIT\Quality\FORD SPC\SPC Analysis\eSPC\[SPC5260-02 cav2 Small Spig Seal Dia Lowest 201217.xlsx]Master'!$Y$3)

The filename in column A in this example would be; SPC5260-02 cav2 Small Spig Seal Dia Lowest 201217.


Is there a way of referencing the filename from column A? Ideally from the sheet but vba if needs be.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This work?
Code:
=INDIRECT("('P:\FORD BUSINESS UNIT\Quality\FORD SPC\SPC Analysis\eSPC\["&$A1&".xlsx]Master'!$Y$3)")
 
Upvote 0
Thank you.

I know from reading, that INDIRECT will only work when the workbook is open, however, saying that, I can't even get that to pull a value in when it's open.
 
Upvote 0
What version of Excel do you use?

What is the value of A1?
 
Upvote 0
If you remove the file path from the formula, does it work?

Also, how is it not working? Error? No result? Something else?
 
Upvote 0
How about
=INDIRECT("'P:\FORD BUSINESS UNIT\Quality\FORD SPC\SPC Analysis\eSPC\["&$A1&".xlsx]Master'!$Y$3")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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