Y
yinya
hello,
I'm trying to get VBA to insert the following formula into Excel,
however, I get a "Expected end of statement error" with all the text
("1", "4", " R", "Error/check") sections in the formula. Would you know
why?
And maybe there's a smarter way to do this?
Range("H2").Formula =
"=IF(OR(LEFT(G2,1)=1,LEFT(G2,1)="1"),VLOOKUP(G2,[Voucher_03.xls]Sheet1!$A:$B,2,FALSE),
IF(OR(LEFT(G2,1)=4,LEFT(G2,1)="4"),VLOOKUP(G2,[POnumbers_03.xls]Sheet1!$A:$B,2,FALSE),IF(LEFT(G2,2)="
R",VLOOKUP(G2,[POnumbers_03.xls]Sheet1!$A:$B,2,FALSE),
"Error/check")))"
BR,
K.
I'm trying to get VBA to insert the following formula into Excel,
however, I get a "Expected end of statement error" with all the text
("1", "4", " R", "Error/check") sections in the formula. Would you know
why?
And maybe there's a smarter way to do this?
Range("H2").Formula =
"=IF(OR(LEFT(G2,1)=1,LEFT(G2,1)="1"),VLOOKUP(G2,[Voucher_03.xls]Sheet1!$A:$B,2,FALSE),
IF(OR(LEFT(G2,1)=4,LEFT(G2,1)="4"),VLOOKUP(G2,[POnumbers_03.xls]Sheet1!$A:$B,2,FALSE),IF(LEFT(G2,2)="
R",VLOOKUP(G2,[POnumbers_03.xls]Sheet1!$A:$B,2,FALSE),
"Error/check")))"
BR,
K.