Reference cell in other workbook using an address concatenated from other cells

gtx_viper

New Member
Joined
Jan 17, 2017
Messages
3
I have the following cells

A1: ="'\\TBGSCOTLAND\Projects\00 Master Files\_ECRs\ECR-G-"
A2: =".xlsx'!"
A6: 3002
C1: cell_ECR_Priority
C6: =$A$1&$A6&$B$1&C$1

C1 to AY contain their own cell names like above
A6 to A1000 contain their own numbers

It was done this way so that C6 could be dragged to put the formula into C6:AY1000

When C6 is evaluated it becomes...

'\\TBGSCOTLAND\Projects\00 Master Files\_ECRs\ECR-G-3002.xlsx'!cell_ECR_Priority

...but it does not link to the cell in that address.

whats the best way of doing this?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the Board!

You would use the INDIRECT function to do that.
See: http://www.contextures.com/xlFunctions05.html#RefWkbk


Hi Joe4,

Tried using INDIRECT but all I get is...

#REF!

...due to the referenced workbook being closed.

When you use the direct link in the cell...

='\\TBGSCOTLAND\Projects\00 Master Files\_ECRs\ECR-G-3002.xlsx'!cell_NCR_REF

...the workbook remain closed.

Unless Ive completely missed something with the indirect function.
 
Upvote 0

Thanks for the help. Was hoping to stay away from putting in some code but your link gave me the idea for the following compromise...

I added a vba module to create a simple custom function which I can drag the way I want.

Function GetData_ECR(ECR_No, CellName)

GetData_ECR = Evaluate("'\\TBGSCOTLAND\Projects\00 Master Files\_ECRs\ECR-G- & ".xlsx'!" & CellName)

End Function

Thanks again
 
Upvote 0
You are welcome!
Glad it helped you come up with a working solution.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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