J
John McClain
Hi there,
In the following formula, VBA interprets the single quotes as a comment line
when I use the ActiveCell.Formula function:
=IF(ISERROR(SUM(INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$1,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)):INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$2,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)))=TRUE),0,SUM(INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$1,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)):INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$2,INDIRECT("'"&WORK_ORDER&"'!2:2"),0))))
The formula is valid when I tyoe it manually in Excel.
I have also tried changing single quotes to doubles, doubles to "double
double" etc, and no luck. Any suggestions would be greatly appreciated.
Thanks,
John
In the following formula, VBA interprets the single quotes as a comment line
when I use the ActiveCell.Formula function:
=IF(ISERROR(SUM(INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$1,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)):INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$2,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)))=TRUE),0,SUM(INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$1,INDIRECT("'"&WORK_ORDER&"'!2:2"),0)):INDEX(INDIRECT("'"&WORK_ORDER&"'!1:10000"),MATCH($J4,INDIRECT("'"&WORK_ORDER&"'!$A$1:$A$10000"),0)+1,MATCH(T$2,INDIRECT("'"&WORK_ORDER&"'!2:2"),0))))
The formula is valid when I tyoe it manually in Excel.
I have also tried changing single quotes to doubles, doubles to "double
double" etc, and no luck. Any suggestions would be greatly appreciated.
Thanks,
John