Solved Error 1004 When Passing Formula to Excel (1 Viewer)

pooldead

Registered User.
Local time
Yesterday, 21:57
Joined
Sep 4, 2019
Messages
136
I have the following formula that runs as expected when used directly in Excel. But when I try to add it into my Access VBA, I get error 1004 "Application Defined or Object Defined Error". I think it has to do with my double-quotes to identify text in the formula, but I don't know how to reconcile it.
Code:
=IFS(ISNA(VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE)),"None",VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE)=0,"None",NOT(ISERR(VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE))),VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE))

Code:
.Range("J2").Formula = "=IFS(ISNA(VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE)),"None",VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE)=0,"None",NOT(ISERR(VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE))),VLOOKUP($C2,'A1 Report'!$A:$E,4,FALSE))"
 

Users who are viewing this thread

Top Bottom