I have this formula in Cell F2 and it works fine:
I am trying to replicate the above formula as a VBA command line and when it tries to execute the 'IsError...' line I am getting an Error #1004 - Unable to get the VLookup property of the WorksheetFunction class.
What am I doing wrong?
Code:
IF(ISERROR(VLOOKUP(A2,INV,1,0))=FALSE,"D","")
I am trying to replicate the above formula as a VBA command line and when it tries to execute the 'IsError...' line I am getting an Error #1004 - Unable to get the VLookup property of the WorksheetFunction class.
Code:
iFound = WorksheetFunction.IsError(WorksheetFunction.VLookup(Range("A2"), Range("INV"), 1, 0))
If iFound = False Then Range("F2").Value = "D"
What am I doing wrong?
Last edited: