+ Reply to Thread
Results 1 to 3 of 3

VBA Vlookup error when searching for all numbers as a string, works fine with letters

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    wheaton, il
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Vlookup error when searching for all numbers as a string, works fine with letters

    Ok,

    I thought I had my code working perfectly as I was testing with a user input of 170X545. My Vlookup code worked perfectly - vlookup is not working when I input 122820. This is a valid input.

    Here is the portion of the code in question. SN is the variable as an input
    "
    Please Login or Register  to view this content.
    "

    now - if I change it to this - it works (with both 170x545 and 122820)...but this would present problems in a later loop portion of my code.

    "
    Please Login or Register  to view this content.
    "


    Basically this tells me that there is some sort of error in the vlookup function with the SN variable. The problem is that I have no idea how to fix that and where to go from here. Any help would be greatly appreciated.

    SN can be all numbers or numbers and text - it also has variable length.

    Please help. Thanks.
    Last edited by Cutter; 08-22-2012 at 07:11 PM. Reason: Added code tags

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VBA Vlookup error when searching for all numbers as a string, works fine with letters

    @ thumpernc24

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    wheaton, il
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA Vlookup error when searching for all numbers as a string, works fine with letters

    Sorry about that. Thanks for helping me out there.

    Bump!

+ 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