+ Reply to Thread
Results 1 to 4 of 4

VLookup Code

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    VLookup Code

    Hi all,

    I have two sheets - Log and Customer ID. Column F of Log has customer numbers and column G is blank; columns A and B of Customer ID have customer numbers and customer names but the customer numbers are formatted as text.

    When I run the following code:

    Please Login or Register  to view this content.
    I get #N/A but when I convert the customer numbers on the sheet Customer ID to “numbers” the VLookup works. However, I still get #N/A for rows where the customer number on Log is blank.

    Therefore, I would like to modify the code to (1) convert the customer numbers on the Customer ID sheet to "numbers" and (2) leave column G on the Log blank, if column F is blank.

    Any help, please?

    Thank you,
    Gos-C
    Last edited by Gos-C; 12-10-2013 at 09:16 PM.
    Using Excel 2010 & Windows 10
    "It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: VLookup Code

    Hi Gos-C, try:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-24-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: VLookup Code

    1. Highlight the Column and at the top in the tool bar the drop down in the number box under the home tab select number.
    2. try this code
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Re: VLookup Code

    Paul, that works perfectly. Thank you! Thank you also, moonsaga.

    Greatly appreciated,
    Gos-C

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  2. [SOLVED] VBA code for change vlookup formula to vlookup formula with ISNA
    By erprasannaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 03:33 AM
  3. Optimizing the Vlookup code in VB. Repitive code with different referencing range.
    By raknahs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2010, 05:03 PM
  4. Using VLOOKUP in VBA code
    By Mark in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-11-2009, 02:32 PM
  5. VLOOKUP at VBA Code
    By Shark Man in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2009, 04:08 PM

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