+ Reply to Thread
Results 1 to 10 of 10

Error message when using (vba) vlookup function

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Error message when using (vba) vlookup function

    Hi,
    I'm running this line (from longer code of course), where i/g are integers and h is a range:
    Please Login or Register  to view this content.
    And I'm getting run time error '1004'. Any idea why?
    Please * if you like the answer

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,238

    Re: Error message when using (vba) vlookup function

    Probably just means that g isn't found in the range h.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Error message when using (vba) vlookup function

    TMS, I see that you're right because when I'm searching g manually in h it is not found AS IS. This is because g=410 (in sheet x) while in h (in sheet y) it is written as 410.1. How would you solve this problem? BTW - replacing FALSE with TRUE in the vlookup function didn't help..

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,238

    Re: Error message when using (vba) vlookup function

    How would you solve this problem?
    Dunno. That's a different question altogether.

    I would suggest that you upload a sample workbook with some typical data, ideally in a new thread (having marked this one as solved.

    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Error message when using (vba) vlookup function

    Yes, sure. A bit later I'll come back to it through a new thread.

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Error message when using (vba) vlookup function

    You can try with .find:
    Please Login or Register  to view this content.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  7. #7
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Error message when using (vba) vlookup function

    bulina, what does the integer I'm receiving represent?

  8. #8
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Error message when using (vba) vlookup function

    Because you declared i as an integer, my guess is that i is the integer part of 410.1. (the found number). If you declare it string it will bring the whole 410.1 string.

  9. #9
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Error message when using (vba) vlookup function

    This is a progress. i returns now 410.1 exactly as in range h. However the "Unable to get the Vlookup property of the WorksheetFunction class" message remains intact

  10. #10
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Error message when using (vba) vlookup function

    Just to update that when I use vlookup manually to check things, it returns N/A which is the equivalent of VBA's message mentioned above. It's weird, and it's not a VBA prob., it's basic than that.

+ 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. [SOLVED] VLOOKUP Error Message
    By ags in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2012, 09:24 PM
  2. Error Message For Function Procedure WITHOUT using a message box
    By bmr8002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 02:01 PM
  3. Getting Rid of Vlookup #N/A Error Message
    By headley4ever in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 12-07-2010, 07:24 PM
  4. Vlookup without error message #N/A
    By Merlin54k in forum Excel General
    Replies: 1
    Last Post: 05-12-2008, 11:34 AM
  5. error message during vlookup
    By Dreamwine59 in forum Excel General
    Replies: 2
    Last Post: 08-17-2006, 10:39 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