Indirect referencing Workbook and Worksheet and Cell - not working

MixedUpExcel

Board Regular
Joined
Apr 7, 2015
Messages
222
Office Version
  1. 365
Platform
  1. Windows
Hi,

This should be straight forward but I can't see what I'm missing.

On Sheet 1 in Cell O4 I have the name of a Workbook (not the one I'm in) but it is open.
On Sheet 2 I have the name of the current Sheetname in Cell P1 (which will be identical sheet on the Workbook I have the name of in Cell O4 on Sheet1)

I am currently in a cell on Sheet2 and want to reference the Workbook name from Sheet1 and the Sheetname from Sheet2

I am trying to use Indirect as both the Workbook name and Sheetname can change in the future.

This is the formula I have but I can't see what I'm missing:

Code:
=INDIRECT("'["&Sheet1!O4&"]"&P1&"'!"&C9)

I know that it should look like this when it pulls through the data:

Code:
='[Workbookname.xlsx]currentsheetname '!$C$9

Please can you someone advise.

Thanks in advance.

Simon
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi,

I've found this as a possible solution:

Code:
[COLOR=#333333][I]=INDIRECT("'[" & Sheet1!O4 & "]" & P1 &"!"&cell("address",C9))[/I][/COLOR]

however, this now references just the cell on Sheet2 (the sheet I'm on)

Any ideas?

Thanks.
 
Last edited:
Upvote 0
To make C9 relative in that sense instead of &"!C9" replace with &"!"&CELL("address",C9)


I.e. INDIRECT("'[" & Sheet1!O4 & "]" & P1 &"!"&CELL("address",C9))
 
Last edited:
Upvote 0
Thank you.

It appears the formula I had was correct, however, if I click into the formula it's selecting the cell on the sheet I'm currently in.

This clearly isn't a true reflection of the formula as it's actually pulling the data from that cell reference on my other workbook.

Anyhow, it works.

So thanks again.

Simon
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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