View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default <<<<excel and VB lookup

Have you tried

head = Worksheetfunction.VLookup(code, "\icodes", 2)

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Tenerife Alan" wrote:

I am using Excel 2003 and Visual Basic 6.3

VLOOKUP works fine in a worksheet but I am having trouble when I try to
invoke it in VB.

My code is

head = VLookup(code, "\icodes", 2)

Where code is a VB variable and "\icodes" is a named range on a worksheet.

I get the error message Function not defined.
--
Tenerife Alan