View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
George Nicholson[_2_] George Nicholson[_2_] is offline
external usenet poster
 
Posts: 170
Default VBA/VLOOKUP Error Message

Cells(1, 3) = Application.WorksheetFunction.Vlookup (A1, INVEN, 2)

and you'll probably need to be more specific (VBA usually won't intrepret A1
or INVEN as easily as Excel does when used in a cell formula):

Cells(1, 3) = Application.WorksheetFunction.Vlookup (Range("A1").Value,
Range("INVEN"), 2)

or even even more specific....:

Cells(1, 3) = Application.WorksheetFunction.Vlookup
(Worksheets("Sheet1").Range("A1").Value,
Worksheets("Sheet2").Range("INVEN"), 2)

Hope this doesn't scare you off,

--
George Nicholson

Remove 'Junk' from return address.


"JimFor" wrote in message
...
Thanks. Where exactly do I place that in the formula? Before the Dim
statement? Before the Cells statement? Add it to a particular line?