General Ledger
Active Member
- Joined
- Dec 31, 2007
- Messages
- 460
Dear All,
I am having trouble in VBA for an Excel 2003 project. The following works fine:
Range("AccountNumber").FormulaR1C1 = "=VLOOKUP(Template,TemplateDetails,4,FALSE)"
The following gives me a run time error 1004 Application-definded or object-defined error:
Range("AccountNumber").FormulaR1C1 = "=IF(ISNA(VLOOKUP(Template,TemplateDetails,4,FALSE)),"", _
VLOOKUP(Template,TemplateDetails,4,FALSE))"
The formula works fine when used in a cell on a worksheet. When I put it into VBA, I get the error. I am guessing the double quotes in the formula are the root of the problem. Do I put quotes around the quotes?
Best regards,
GL
I am having trouble in VBA for an Excel 2003 project. The following works fine:
Range("AccountNumber").FormulaR1C1 = "=VLOOKUP(Template,TemplateDetails,4,FALSE)"
The following gives me a run time error 1004 Application-definded or object-defined error:
Range("AccountNumber").FormulaR1C1 = "=IF(ISNA(VLOOKUP(Template,TemplateDetails,4,FALSE)),"", _
VLOOKUP(Template,TemplateDetails,4,FALSE))"
The formula works fine when used in a cell on a worksheet. When I put it into VBA, I get the error. I am guessing the double quotes in the formula are the root of the problem. Do I put quotes around the quotes?
Best regards,
GL