External references, variable or dynamic formula

dlorenc

Board Regular
Joined
Aug 17, 2004
Messages
140
This works:

='https://Construction Weekly Reports/[P02-WS.xlsx]2.4.12'!D$4

I would like to replace 2.4.12 with a cell reference (T1, which would contain "2.4.12" ...)

I know this does not work:

='https://Construction Weekly Reports/[P02-WS.xlsx]'T1!D$4

thank you for the help!


if it matters, the external excel sheet is in a sharepoint site...
 
1. sorry.. changing the T1 to "2.4.12" (with double quotes) produces the same #REF! error....

when I change the T1 to t1, it does change the formual to T1... and produces the same #ref! error.

2. removing the double quote gives ma a "The formula you typed contains an error"... message...
Does this work?
Code:
="'https://Construction Weekly Reports/[P02-WS.xlsx]"&T1&"'!"&D$4
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Does this work?
Code:
="'https://Construction Weekly Reports/[P02-WS.xlsx]"&T1&"'!"&D$4

mm... this one does not ... totally evaluate...calculate?... it seems to think the lead url is text but resolves the T1 and D4 to local cells...??.

displays as

'https://Construction Weekly Reports/[P02-WS.xlsx]]2.4.12'!305

T1 = 2.4.12

D4 in this worksheet is 305 ...
 
Last edited:
Upvote 0
The entire formula must be passed to INDIRECT:

=INDIRECT("'https://Construction Weekly Reports/[P02-WS.xlsx]"&T1&"'!D$4")

but that said, INDIRECT doesn't work with a closed workbook.
 
Upvote 0
I opened the external workbook in the same excel session.

I still get a #REF!.. when I do the evaluate steps I find:

indirect("'https://Construction Weekly Reports/[P02-WS.xlsx]2.4.12'!D$4") ... looks pretty close..???..
 
Upvote 0
hold the phone!!!...

I closed my workbook..(leaving the external workbook opened... leaving the external workbook active, I did an recent...open the workbook doing the referencing..and it WORKED!... bit strange on why closing and reopening seemed to make a difference..but it did...??..

ok..so..now I have a working reference.. I can do a process change that requires the user to open all twelve workbooks from which I want do a data pull.. (ick)... but it is..what it is....

unless someone can come up with a different process... this might be as good as it gets...mm?...

in which case..THANK YOU JOEMO and ANDREW..y'all ROCk!
 
Upvote 0

Forum statistics

Threads
1,215,206
Messages
6,123,638
Members
449,109
Latest member
Sebas8956

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