+ Reply to Thread
Results 1 to 15 of 15

Macro for lookup

  1. #1
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Macro for lookup

    Hello,

    can someone help me with a macro instead of the Vlookup formula
    in the attachment you can find the example excel file

    In column A we have a lot of values, these are the look up values.
    In column D2:BL66 is the table array.
    The values from column A may occur in D2:BL66 (not all in this example), should be linked to the values in column BN

    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for lookup

    Hi WillemB,
    maybe so
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Macro for lookup

    or without tables (probably somewhat slower)
    Please Login or Register  to view this content.
    edit: I was wrong, a bit quicker, but the difference is pretty small.
    Last edited by Kaper; 02-24-2014 at 09:35 AM.
    Best Regards,

    Kaper

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for lookup

    as an option
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    Thanks Nilem,

    Is it also possible if the value in column BN is a text like (example FRGTESAF

  6. #6
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    Hoi Nilem,

    Just run your second macro, it works great!

    Thanks!!

  7. #7
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    Nilem,

    short question,
    is it possible to run the macro on an other sheet than where the table array is?

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for lookup

    something like this
    Please Login or Register  to view this content.

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Macro for lookup

    WillemB,
    What do you mean? Put the results on a different sheet than where the lookup table is? Easy, just need to reference the correct sheet in the code.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  10. #10
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    I did, but nothing happens,

    just have the table array on sheet 1
    and the look up on sheet 2 column B
    have to fill in the linked value to sheet 2 column D

  11. #11
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for lookup

    Can you attach an example of your file?

  12. #12
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    here the exampl2
    Attached Files Attached Files

  13. #13
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro for lookup

    try
    Please Login or Register  to view this content.

  14. #14
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Macro for lookup

    I added references to sheets and corrected ranges and these were only changes needed to previous macro:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    11-08-2013
    Location
    the Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Macro for lookup

    Hoi Nilem,
    It's working Thanks!!

+ 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. V Lookup and Macro.
    By RMGraham in forum Excel General
    Replies: 0
    Last Post: 08-21-2012, 03:30 PM
  2. lookup macro help
    By mm5384 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2012, 10:29 AM
  3. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  4. Lookup in a Macro
    By jellyman_77 in forum Excel General
    Replies: 2
    Last Post: 08-13-2010, 08:59 AM
  5. Lookup or Macro ? - Not sure which is best?
    By conks in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2008, 10:54 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