View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default #NA error using vlookup in vba

Perhaps we need to tell excel what cobstore is?
Sub lookitup()
cobstore = 1
Range("I15") = Application.VLookup(cobstore, _
Worksheets("sheet4").Range("d2:e188"), 2)
End Sub

--
Don Guillett
SalesAid Software

"Noemi" wrote in message
...
Hi
I have the following formual in VBA and I keep getting the #NA in the

ouput
cell and I dont know why.

Dim stNumber As String
Dim stans As Variant

stNumber = cobStore.Value
stans = Application.VLookup(stNumber,
Worksheets("Numbers").Range("A2:B188"), 2)

Range("I15").Value = stans

can someone please help.

Thanks
Noemi