+ Reply to Thread
Results 1 to 5 of 5

dynamic VLookup

  1. #1
    Registered User
    Join Date
    09-04-2008
    Location
    Baltimore
    Posts
    8

    dynamic VLookup

    Hello - I am working on a small file that will compare email addresses from column A and Column B. If the email address from Column B matches, the formula will show "Yes" and if not, "No".

    HOWEVER, I wish to include this in a macro and the two lists will always be of varying lengths.

    Is there a way in which I can 'tell' excel how long each list is, or have it run the vlookup and erase/clear those columns w/o data in them?

    Any advice/links to previously-written assistance will be much appreciated.

    -MK
    Last edited by VBA Noob; 04-10-2009 at 02:32 PM.

  2. #2
    Registered User
    Join Date
    12-16-2006
    Location
    Bangkok
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Help with VLookup

    Hi

    Are you using Vlookup? if yes, what is not working
    pls show your formula

    cheers, francis

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Help with VLookup

    Hi and welcome to the board
    Is there a way in which I can 'tell' excel how long each list is, or have it run the vlookup and erase/clear those columns w/o data in them?
    To solve this part of your question,, have a look at Dynamic ranges

  4. #4
    Registered User
    Join Date
    09-04-2008
    Location
    Baltimore
    Posts
    8

    Re: Help with VLookup

    Merci, Arthur.

    Another ? - Here is my vlookup

    =IF(ISNA(VLOOKUP(A2,$D$2:$D$185,1,FALSE)),"No","Yes")

    How can I replace the "185" after the D with the dynamically-created value of a cell ?

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: dynamic VLookup

    you can use indirect
    e.g.
    =VLOOKUP(A2,INDIRECT("D2:"&E1),1,FALSE) where e1 contains D185
    or
    =VLOOKUP(A2,INDIRECT("D2:D"&E1),1,FALSE) where e1 contains 185
    but if you are using a macro thats probably unnecessary ther are diferent methods for dynamic ranges.
    Last edited by martindwilson; 04-10-2009 at 06:30 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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