HOW DO I USE THE VLOOKUP AS A FUNCTION IN VBA CODE


Posted by GaD on September 20, 2001 11:34 AM

HOW DO I USE VLOOKUP FUNCTION IN VBA

I AM TRYING:

sTEXT = Excel.WorksheetFunction.VLookup("01234", _
Range("A1:B99"),2,FALSE)

But I get an Error

Posted by Jaime on September 20, 2001 5:41 PM

sTEXT = Application.VLookup(323, Range("A1:B99"), 2, False)


I got this to run ok. I think the quotation marks u have around the number is what is given you the problem.
Also remember the lookup value must be in the first column of the range ur looking up.



Posted by GaD on September 21, 2001 1:07 PM

Jamie,

Thank you, thats great !!

Ger