W
wpiet
"If .WorksheetFunction.IsNA _
(.WorksheetFunction.VLookup(CopyVal, LookupRng, 1, False)) Then "
If CopyVal does not exist in the leftmost column of LookupRng, I get
"Run-time error '1004': Unable to get the VLookup property of the
WorksheetFunction class."
If CopyVal is a value that exists in LookupRng, the code gets past the If
statement, since the value of the VLookup is not = #N/A.
Excel 2003 Help for function VLOOKUP states, in re: Range_lookup, "If FALSE,
VLOOKUP will find an exact match. If one is not found, the error value #N/A
is returned."
Why, then, does the VLookup fail, rather than return #N/A, if the value is
not there?
(.WorksheetFunction.VLookup(CopyVal, LookupRng, 1, False)) Then "
If CopyVal does not exist in the leftmost column of LookupRng, I get
"Run-time error '1004': Unable to get the VLookup property of the
WorksheetFunction class."
If CopyVal is a value that exists in LookupRng, the code gets past the If
statement, since the value of the VLookup is not = #N/A.
Excel 2003 Help for function VLOOKUP states, in re: Range_lookup, "If FALSE,
VLOOKUP will find an exact match. If one is not found, the error value #N/A
is returned."
Why, then, does the VLookup fail, rather than return #N/A, if the value is
not there?