I think this should be very simple but I have had no luck being able to do it or look for it on the internet. Clearly, I am missing something very obvious.
I have a cell, lets say A1, that contains the following file path:
'C:\[Required file path]Sheetname'
now I want to use this to create a formula in cell B1, lets say,:
=Trim('C:\[Required file path]Sheetname'!B26)
Since this link will be decided dynamically, I want to be able to do something like this:
=Trim(A1!B26)
Where A1 = my required filepath. But this does not work.
Hope I am clear enough in explaining the problem. Thanks in anticipation!!
Try:
Where A1 holds a reference like: C:\Users\User\Desktop\Test.xlsx.
It may prompt you with a file browser - just select the document which you are trying to reference (e.g. Test.xlsx)
If your second workbook( with path
'C:\[Required file path]Sheetname'
) is open (but in this case you needn't to use full path to workbook, it's enough to use only WB name), you can useINDIRECT
formula (if yourA1
contains''C:\[Required file path]Sheetname'
):But if your second workbook is closed, the way I found is to add user defined function to your first workbook and use it:
where
getValue
defines as: