I am using the following statement

if worksheetfunction.iserror(worksheetfunction.vlookup(sheet1.cells(i,j).value,sheet2.range("range1"),2,0)) = true then

can you please whether this is legal... my vba compiler is crashing when i am trying this