问题
I am using indirect function to create a link into another closed workbook. The objective is to retrieve the values without opening the workbook. I have used the following in one place which works.
=INDIRECT("[NVOL.xlsb]Sheet1!A"&C6)
However, in another place in the same sheet, the following does not work (gives a #ref error)
=INDIRECT("[MTM.xlsb]Sorted!A"&B6)
It appears [NVOL.xlsb]
is taken as a substitute for the full path but the full path is not visible. I have two questions
a) The path in the former case (NVOL) somehow vanished. How do I make it sure it is visible so that the path can be changed if necessary?
b) How to make sure the MTM.xlsb is infact backed by a full path?
回答1:
Both workbooks must be open and Excel is very fussy about the syntax:
=INDIRECT("'C:\TestFolder[ABC.xls]NewName'!B" & A1)
(double quote) (single quote) (path name) (bracket) (file name) (close bracket) (!) (cell address) (double quote)
来源:https://stackoverflow.com/questions/22046546/using-indirect-function-in-excel