I'm triying to reference the value of a cell that is in another spreadsheet file. I know that I can do by using
=[file.xlsx]Worksheet!A1
But the file name is hardcoded in the formula and what I want is to reference it as a named cell. So suppose I define B1 as a named cell called "FileName". Then I try:
=[FileName]Worksheet!A1
I get a #REF error.
How can I use the value of a named cell to reference another file?
You have to use INDIRECT
.
=INDIRECT("'[" &B2 & "]worksheet'!$A$1")
..then replace the worksheet name.