+ Reply to Thread
Results 1 to 2 of 2

vlookup-Dim stNumber As String

  1. #1
    Noemi
    Guest

    vlookup-Dim stNumber As String

    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

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Is it possible that cobStore.Value is less than the value in A2 (of the range)?

    Try dropping stans into a spare cell to ensure the 'lookup' is valid.

    Hope this helps



    Quote Originally Posted by Noemi
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1