Hi,
I have the following formula, which works when I type it into a cell in excel:
However, when I try to put this in VBA, I keep getting errors...I believe it's because of the double quotes and single quotes:
I have tried to put in Chr(39) for single quotes and Chr(34) for double quotes, but it doesn't seem to work...
Anyone got any ideas as to why this won't work? Could it be because of Indirect? I think I can remember having issues with Indirect in VBA previously.
Thanks,
Eoin
I have the following formula, which works when I type it into a cell in excel:
Code:
=OFFSET(INDIRECT("'" & $AM6 & "'!$A$" & MATCH($A6,INDIRECT("'" & $AM6 & "'!$A:$A"),0)),31,1)
However, when I try to put this in VBA, I keep getting errors...I believe it's because of the double quotes and single quotes:
Code:
Tfc.Cells(6, 26)="=OFFSET(INDIRECT("'" & $AM6 & "'!$A$" & MATCH($A6,INDIRECT("'" & $AM6 & "'!$A:$A"),0)),31,1)"
I have tried to put in Chr(39) for single quotes and Chr(34) for double quotes, but it doesn't seem to work...
Anyone got any ideas as to why this won't work? Could it be because of Indirect? I think I can remember having issues with Indirect in VBA previously.
Thanks,
Eoin