+ Reply to Thread
Results 1 to 9 of 9

LookUp Code in VBA

  1. #1
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    LookUp Code in VBA

    Hi,

    Im using the following lookup code in VBA but cannot make it work:


    Please Login or Register  to view this content.
    The thing is that:
    Range("A" & x) is located in Sheet3
    Range("A9:A15") is located in Sheet2
    Range("F9:F15") is located in Sheet2

    Thanks!

    Regards,

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: LookUp Code in VBA

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LookUp Code in VBA

    Hi!

    It pops up an error also... "Unable to get the Lookup property of the WorksheetFunction class"

  4. #4
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LookUp Code in VBA

    Hi again!

    I manage to make work it work with the code above but it displays #NA instead the values... strange...

    I have attached my workbook if it helps.

    Thanks!!

    Regards
    Attached Files Attached Files

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: LookUp Code in VBA

    Give this a try,

    Please Login or Register  to view this content.
    Last edited by mike7952; 08-30-2012 at 09:37 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: LookUp Code in VBA

    Quote Originally Posted by pezalmendra View Post
    I manage to make work it work with the code above but it displays #NA instead the values... strange...
    Because your first value is range and not cell.

    Please Login or Register  to view this content.
    Check mine example above. You need to use first cell Sheets("Trips Overview").Range("AU9") and then loop to others.
    see mike's solution.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: LookUp Code in VBA

    Also if your going to use the Lookup you need to convert your values in column A to numbers

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LookUp Code in VBA

    Yesss!! works great mike!!!
    thanks you both for the help and attention!!!

    Regardssss!!!

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

    Re: LookUp Code in VBA

    @ pezalmendra

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ 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