Struggling to find a working solution to this one. The scenario :-
Data files are stored each month in a relative folder (the same file name, sheet name and cell reference) so the folder structure looks something like
C:\DataFiles\2011\Jan
C:\Data Files\2011\Feb
C:\Data Files\2011\Mar
.... etc
VBA cannot be used for security - this is not optional in any way - hence why I need the formula.
What I intended to do was, in a summary workbook held on a different drive location, build the filename and path up from the result of several cells, i.e.
A1 has the path - C:\Data Files\ (the path contains spaces which is out of my control and cannot be changed)
A2 contains todays date displayed as a year (YYYY)
A3 contains todays date displayed as a month (MMM)
so in B1 I expected the formula to read something like :-
="'" & A1 & A2 & "\" & A3 & "\[Book1.xls]Sheet1'!Z26" (where Sheet 1 Z26 contains the value I am after)
It displays the correct text string, but does not actually perform the "paste link" style function. The summary file will have many references to closed workbooks, so simply asking the end user to change the cell reference to a different month is a no go.
I have tried inserting an equals sign at the begining of the string, i.e. "='" & A2 etc, but all that happens then is that Excel automatically inserts another ' as the first character in the cell. If I manually remove the preceeding ' the formula then works and displays the required value, therefore I know my string is correct in its syntax.
Any help greatly appreciated.
Data files are stored each month in a relative folder (the same file name, sheet name and cell reference) so the folder structure looks something like
C:\DataFiles\2011\Jan
C:\Data Files\2011\Feb
C:\Data Files\2011\Mar
.... etc
VBA cannot be used for security - this is not optional in any way - hence why I need the formula.
What I intended to do was, in a summary workbook held on a different drive location, build the filename and path up from the result of several cells, i.e.
A1 has the path - C:\Data Files\ (the path contains spaces which is out of my control and cannot be changed)
A2 contains todays date displayed as a year (YYYY)
A3 contains todays date displayed as a month (MMM)
so in B1 I expected the formula to read something like :-
="'" & A1 & A2 & "\" & A3 & "\[Book1.xls]Sheet1'!Z26" (where Sheet 1 Z26 contains the value I am after)
It displays the correct text string, but does not actually perform the "paste link" style function. The summary file will have many references to closed workbooks, so simply asking the end user to change the cell reference to a different month is a no go.
I have tried inserting an equals sign at the begining of the string, i.e. "='" & A2 etc, but all that happens then is that Excel automatically inserts another ' as the first character in the cell. If I manually remove the preceeding ' the formula then works and displays the required value, therefore I know my string is correct in its syntax.
Any help greatly appreciated.