How to reference a cell in workbook 2 using a filename typed in a cell workbook 1

knighttrader

New Member
Joined
Apr 3, 2010
Messages
21
Office Version
  1. 2021
Platform
  1. MacOS
Hi

See attached screenshot.

I have two workbooks.
1. Data_Workbook.xlsm
2. Data_Analysis.xlsm

I want the value of '[Data_Workbook.xlsm]Sheet1'!$BP25 to appear in cell B4 of Data_Analysis.xlsm.

The name of the Data_Workbook.xlsm will be typed in cell B2 of Data_Analysis.xlsm.

Obviously I can type the Data_Workbook address directly into the formula in cell B4, however, I want the formula in cell B4 to use the workbook name typed in cel B2. E.g. '[B2.xlsm]Sheet1'!$BP25

Any idea if/how I can do that?

Many thanks
 

Attachments

  • Screenshot 2022-02-04 at 18.42.53.png
    Screenshot 2022-02-04 at 18.42.53.png
    22.2 KB · Views: 1

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try this in B4:
Excel Formula:
=INDIRECT("'["&B2&".xlsm]Sheet1'!$BP25")

It worked with a slight modification. The file extension needs to be in quotes too, or removed.

Excel Formula:
=INDIRECT("'["&B2&".xlsm"&"]Sheet1'!$BP25")

Many thanks for the help.
 
Upvote 0
The file extension needs to be in quotes too
You are correct, but you don't need so many part-strings and quote marks.
Excel Formula:
=INDIRECT("'["&B2&".xlsm]Sheet1'!$BP25")

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Solution
You are correct, but you don't need so many part-strings and quote marks.
Excel Formula:
=INDIRECT("'["&B2&".xlsm]Sheet1'!$BP25")

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Okay, many thanks Peter.

I've updated my account as suggested.
 
Upvote 0

Forum statistics

Threads
1,214,544
Messages
6,120,126
Members
448,947
Latest member
test111

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