I have a line in an Excel 2010 vb code that is throwing a Run-time error 1004:
Application-defined or objexct-defined error
The line of code is:
Range("E21").Formula = "=IFERROR(LOOKUP(2,1/(('Earn Roll'!A:A='Department Workcenter Load'!A21)*('Earn Roll'!B:B='Department Workcenter Load'!C21)),'Earn Roll'!C:C),"")"
the equation returns the desired result if when I enter it in cell E21 of worksheet 'Department Workcenter Load'
Any help would be appreciated.