+ Reply to Thread
Results 1 to 4 of 4

using of vlookup in vba

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    using of vlookup in vba

    Hi All

    I have a sheet1 with data, Sheet2 with a command button (vlookup) , Sheet3 shows the results.
    I have written the following code but it throws errors regarding 1004. It worked for some time and then
    suddenly started throwing up errors.

    The sheet 1 contains

    a1: country code
    b1: country name
    c1: Hockey Players
    d1: Footlball Players
    E1: Cricket Players


    Please Login or Register  to view this content.

    dd.png

  2. #2
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: using of vlookup in vba

    Both lines work for me when I put this line in case the Country is not found:
    Please Login or Register  to view this content.
    Last edited by tuongtu3; 09-25-2013 at 07:04 PM.

  3. #3
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Re: using of vlookup in vba

    Check the file, i have attached, It gives the error message even when the country code exists on sheet1.
    command button is on sheet2, while results should appear on sheet 3.

    Many thanx
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: using of vlookup in vba

    Try the sample in attached.

    Regards,
    tt3
    Attached Files Attached Files

+ 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. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  2. [SOLVED] Vlookup is not working and giving =vlookup(B2,$T$2:$U$135,2,false) this kind of values.
    By yogeshsharma1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 04:08 PM
  3. how to bring all vlookup returns even with duplicate vlookup search keys
    By NYC4LIFE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2013, 04:53 PM
  4. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  5. Replies: 5
    Last Post: 07-29-2009, 07:53 AM

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