+ Reply to Thread
Results 1 to 5 of 5

Match Value in range with value in another range & output third value -vlookup for ranges?

  1. #1
    Registered User
    Join Date
    11-25-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Match Value in range with value in another range & output third value -vlookup for ranges?

    Hi guys,
    I'm new to VBA and have been learning and playing around with various arguments over the past few bays but I still cant get it to do what I want to.
    basically I have 3 worksheets -
    "Company String Elements" with a 'bank' of string values in column A with altered strings in column B
    "Variables page" with a column of drop down selections for all the 'banked' string values from column A on "Company String Elements" sheet
    "Output" where I want to produce a list of the altered values (from "Company String Elements" column B) when the banked values on "company string elements" match any of the values selected from the drop down menus on "variables page".
    for example - lets say Macdonalds is in A3 of the Company string elements worksheet and if I Select Macdonalds from the "variables page" worksheet drop down and click the button on "output page" I want to see the Altered string value from B3 plus any other matching values from the drop downs.
    So far I've managed to get a list of 'altered' strings by using a loop:

    Please Login or Register  to view this content.
    But this would only work if the drop downs are selected in the same order as they are in-putted on the company string elements worksheet.
    so then I had a thought to use just one list with tick boxes and have some kind of IF rule loop but thought this would probably open a huge can of worms.

    in an ideal world all of the matching strings would be concatenated but a list that I can then concatenate would be fine.

    I hope this makes sense....?
    any help would be really appreciated!
    Thanks again,
    Thom.
    Last edited by tomhardy1491; 11-25-2015 at 01:23 PM.

  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,213

    Re: Desperate for Help

    From your description, I have no idea what you are trying to do

    However, if you have a list of values and their replacement values, you can use Application.WorksheetFunction.VLookup( ... ) in much the same way as you would on a worksheet. The lookup value would be the cell you are processing; the lookup range would be Sheets(" ... ").Range(" ... ") where the sheet and range strings reflect where the lookup table is; and the return column would be 2, with FALSE as the last parameter for an exact match.


    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
    Registered User
    Join Date
    11-25-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Desperate for Help

    Thanks for your help TMS,

    I probably wasn't clear enough in my description, let me try again.
    What I am trying to do it create a search string generator.

    What I want to be able to do is select a number of attributes from drop down menu's linked to my "bank" of attributes.
    With my 'bank' of attributes I have how these convert to boolean in column B e.g IT would convert to ("Information technology" OR IT OR ICT)

    So once I have selected these list of attributes I want something that can match them to the "bank" and produce a list of "search string elements" that can then be put together to give me my overall search string.

    Does this make the situation any clearer?

    from my understanding of Vlookup it can only match one variable at a time and not a whole list?

    apologies if not and thanks again for your support.

    Thom.
    Last edited by tomhardy1491; 11-25-2015 at 12:43 PM.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: Desperate for Help

    Descriptive title and tags added by OP. Thanks
    Last edited by Pepe Le Mokko; 11-25-2015 at 01:34 PM.

  5. #5
    Registered User
    Join Date
    11-25-2015
    Location
    England
    MS-Off Ver
    2016
    Posts
    4

    Re: Match Value in range with value in another range & output third value -vlookup for ran

    Thanks Pepe.

+ 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. Desperate Help Please
    By boyniceasdf in forum Excel General
    Replies: 1
    Last Post: 05-17-2010, 03:18 AM
  2. Excel 2007 : Desperate
    By Daddy Dumpsalot in forum Excel General
    Replies: 2
    Last Post: 12-18-2009, 07:04 PM
  3. Desperate need of help!
    By dkoroz in forum Excel General
    Replies: 1
    Last Post: 12-10-2008, 01:07 PM
  4. Desperate...please help!
    By sas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2006, 04:15 PM
  5. In desperate need of help....
    By mrskitz in forum Excel General
    Replies: 3
    Last Post: 01-13-2006, 10:48 AM
  6. [SOLVED] Desperate NEED!!!!
    By huntr357 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2005, 12:06 PM
  7. help desperate!!!
    By antongucci in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-02-2005, 12:15 PM

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