Hi,
Quote:
want to be able to change the file name and the folder name, I tried to do something like this but I always get an error.
='\\mylocation\folder1\folder' & A1 & '2\[file' & B1 & '.' & B1 & ']Sheet1'!$A$1
|
Excel considers this to be a string and not a range reference. There's a worksheet function called INDIRECT() which can be used to convert a string to a range reference. Unfortunately there are two drawbacks to using INDIRECT():
- It's a volatile function.
- If it's pointing at an external workbook which is closed, it returns an error value.
Point 2 is the big factor for your question because you are trying to reference an external workbook.
With INDIRECT() put to one side, your options are either to write (or borrow) some VBA code or to install an add-in which has the required functionality. Some choices are discussed on
this thread at Daily Dose Of Excel including:
- MOREFUNC.XLL which includes the INDIRECT.EXT function
- Harlan Grove's PULL function
Hope that helps...