Dynamic File path depending on cell data

Wookie

Board Regular
Joined
Mar 4, 2003
Messages
220
I think this is possible but cant find anything on it

if i have link to an other work book
'O:\Accounts\Actuals\Submitted Packs\[Europe Ltd.xls]P&L'!F7
but i want to change the Europe Ltd part is it possible to do this by having a list of the companies in say column A and the link referencing this.

so if A1 had Europe Ltd in it
'O:\Accounts\Actuals\Submitted Packs\[Europe Ltd.xls]P&L'!F7
B1 - Asia Ltd
'O:\Accounts\Actuals\Submitted Packs\[Asia Ltd.xls]P&L'!F7

and so on
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I think this is possible but cant find anything on it

if i have link to an other work book
'O:\Accounts\Actuals\Submitted Packs\[Europe Ltd.xls]P&L'!F7
but i want to change the Europe Ltd part is it possible to do this by having a list of the companies in say column A and the link referencing this.

so if A1 had Europe Ltd in it
'O:\Accounts\Actuals\Submitted Packs\[Europe Ltd.xls]P&L'!F7
B1 - Asia Ltd
'O:\Accounts\Actuals\Submitted Packs\[Asia Ltd.xls]P&L'!F7

and so on

For open books...

=INDIRECT("'O:\Accounts\Actuals\Submitted Packs\["&A1&"]&"P&L'!F7")

For closed books...

=INDIRECT.EXT("'O:\Accounts\Actuals\Submitted Packs\["&A1&"]&"P&L'!F7")

which requires the morefunc.xll add-in.
 
Upvote 0
I have tried the below but it doesnt seem to like the &"P&L'!F7 part. Any ideas why this would be. I thought maybe a missed " but it still doesnt work

=INDIRECT.EXT("'O:\Accounts\Actuals\Submitted Packs\["&A1&"]&"P&L'!F7")
 
Upvote 0
I have tried the below but it doesnt seem to like the &"P&L'!F7 part. Any ideas why this would be. I thought maybe a missed " but it still doesnt work

=INDIRECT.EXT("'O:\Accounts\Actuals\Submitted Packs\["&A1&"]&"P&L'!F7")

What result do you get?
 
Upvote 0
it tells me i the formula i have typed contains an error and the highlights the "P in the formula
 
Upvote 0
Still not working, is there any other reasons that it may not work rather than the formula being incorrect. i cant see anything wrong with the formula and in my head it works but in practise it doesnt.
 
Upvote 0
Still not working, is there any other reasons that it may not work rather than the formula being incorrect. i cant see anything wrong with the formula and in my head it works but in practise it doesnt.

=INDIRECT.EXT("'C:\Accounts\Actuals\Submitted Packs\["&A1&"]P&L'!F7")

Just checked... It appears to work. And, again, what result do you get?
 
Upvote 0
Right, i get this to work when i open the workbook but not when it is closed. i get a #VALUE! error when the workbook is closed
 
Upvote 0

Forum statistics

Threads
1,215,316
Messages
6,124,228
Members
449,149
Latest member
mwdbActuary

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