mercredi 25 août 2021

Object defined error with VBA if formulas

I have a macro that is populating data in a table. For some reason when i do the below IF formula in order to remove "0"i get an object-defined error. but if i just use the vlookup it works fine.

Object-defined error

Range("G1").Value = "Email"
Range("G2").Value = "=IF(VLOOKUP([@[Standard ID]],CARMA1!A:D,3,0) = 
0,"",VLOOKUP([@[Standard ID]],CAMRA1!A:D,3,0))"

Works fine

Range("G1").Value = "Email"
Range("G2").Value = "=VLOOKUP([@[Standard ID]],CARMA1!A:D,3,0)

any idea why?

Aucun commentaire:

Enregistrer un commentaire