Direct Workbook reference

snowmansmartie

New Member
Joined
Jun 19, 2013
Messages
14
Hi guys,

I have 2 workbooks.

WB1 is stored in a Sub-Folder with a Username and stores a list of figures
WB2 is stored in the Root Folder and pulls information from WB1. For each User there is a separate Tab. I know by using =REPLACE(CELL("filename",A1),1,FIND("]",CELL("filename",A1)),"") will give me the Sheet Name.

What I would like to do is where I have a link - ='c:\scores\username\[Ticket Audit Form.xlsx]Week 1 Audit'!$B$130 - Where the username is I want to pull this from the sheet tab as they will be the same.

I have already tried to concatenate the replace formula in, but this doesn't work. Any help would be appreciated.

Cheers
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Normally you'd use INDIRECT to use dynamic reference to sheet names etc. However, with closed workbook, INDIRECT will not work.

I'd recommend one of following methods.

1. ADODB Connection via VBA
2. MS Query connection (via data tab)
3. If you have access to PowerQuery, connection set up via PowerQuery along with Named ranges to pass parameter.
 
Upvote 0
Thanks Chihiro, however Im not after HOW to return the data I can do this via ='c:\scores\username\[Ticket Audit Form.xlsx]Week 1 Audit'!$B$130 and this works a treat.

The issue I have is that there are multiple of these references on a single tab, and when I setup a new user (new tab in the workbook), I've got to go through the whole sheet and change these references to the New Users folder.

What I am looking for is a formula to change the above \username\ part to take the name of the tab as the tab and the folder name will be the same. This means I can setup a new Tab, and it will automatically point to the correct directory without me having to go through it.
 
Upvote 0
Only way to change it en mass it via Find & Replace. Assuming folder path is the only variable, just copy one of the sheet and replicate. Then replace all instances with new reference to the folder.

I usually set up sheet containing user list and use that to pass connection string to ADODB and pull in info that way.
 
Upvote 0

Forum statistics

Threads
1,214,627
Messages
6,120,610
Members
448,973
Latest member
ChristineC

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