Vlookup Error
If you drop the .worksheetfunction, you can test for the error:
dim mtch as Variant 'could return an error
mtch = Application.WorksheetFunction.VLookup( _
Worksheets("Nabanco").Cells(nr, 14).Value, _
Worksheets("RDMTemp").Range("A1:T5000"), _
20, False)
if iserror(mtch) then
'it returned an error
else
'no error
end if
MJRay wrote:
Hello,
I have the following code to perform a lookup:
mtch = Application.WorksheetFunction.VLookup( _
Worksheets("Nabanco").Cells(nr, 14).Value, _
Worksheets("RDMTemp").Range("A1:T5000"), _
20, False)
The error I get is "Run time error 1004, Unable to get the vlookup property
of the WorksheetFUnction class.
Thanks,
Mike
--
Dave Peterson
|