It can mean any number of things. It might just mean that your Data(i, 4) value was not found in LookupRange.
Run-time error '1004': Unable to get the VLookup property of the WorksheetFunction class
equivalent to getting #N/A From =vlookup("A",A1:B3,2,false)
Set a breakpoint on the line
test(i) = Application.WorksheetFunction.VLookup(Data(i, 4), LookupRange, 3, 0)
and set the clock Data(i, 4) , as well as the clock to i . See if the value in Data(i, 4) exists in your search range. See if i greater than 1, if it correctly completed several iterations of the loop.
As a side note, your code doesn't work at all, since Test is an empty option, not an array. You need a string like
ReDim Test(LBound(Data, 1) To UBound(Data, 1))
before the for loop to make it work.
Read about the processing error here . You will need to properly handle VLOOKUP with VBA.
source share