+ Reply to Thread
Results 1 to 10 of 10

Selecting rows in a table based on another list

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Selecting rows in a table based on another list

    Hi,
    Any help would be much appreciated here. I have attached the data in an excel file here. I'd like to select (or highlight) the rows (based on names) in the table on sheet1 based on the list provided in sheet 2. I've been struggling with using a formula for this one. The list on sheet 2 may be longer than the table on sheet 1(since there are entries on the list which might not be present in the table column 2), and the reverse may also be true. I would like to select "entire rows" of names in the table that are there on the list on sheet 2, not just the names column in the table. See the desired result on sheet 3.
    Thanks for your assistance in advance.
    Attached Files Attached Files
    Last edited by bedik; 01-31-2013 at 12:25 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Selecting rows in a table based on another list

    Not seeing anything in sheet2. Can you please where is the list appears in sheet2? and also show the expected result for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Selecting rows in a table based on another list

    Quote Originally Posted by :) Sixthsense :) View Post
    Not seeing anything in sheet2. Can you please where is the list appears in sheet2? and also show the expected result for better understanding
    Hi, I just updated the excel sample sheet. Thanks for the quick response.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Selecting rows in a table based on another list

    I would like to go for VBA Solution rather than building a complex formula. Open the attached file and click Run Macro which will get the data based on the Sheet to conditions.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-30-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Selecting rows in a table based on another list

    Hi,
    So the code that you provided above basically selected only those rows from the table whose names matched with the list on sheet 2. I can work with that as well, thank you so much. But being a total noob with macros and VBA solutions, I was wondering how would I apply/replicate the code/VBA solution to my actual dataset?

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Selecting rows in a table based on another list

    Yes exactly

    If your data source is also same like your example file then just follow the below link to know how to add the code in your file.

    http://www.contextures.com/xlvba01.html

    Otherwise just show the format of your data so that slight changes can be done according to your source data.

  7. #7
    Registered User
    Join Date
    01-30-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Selecting rows in a table based on another list

    Quote Originally Posted by :) Sixthsense :) View Post
    Yes exactly

    If your data source is also same like your example file then just follow the below link to know how to add the code in your file.

    http://www.contextures.com/xlvba01.html

    Otherwise just show the format of your data so that slight changes can be done according to your source data.
    I'll try to work with this and get back to you if it works out. Thanks for providing this useful link. I however didn't understand what you meant by "show the format of your data".

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Selecting rows in a table based on another list

    show the format of your data is meant for the column / row references and sheet names of the data.

  9. #9
    Registered User
    Join Date
    01-30-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Selecting rows in a table based on another list

    Quote Originally Posted by :) Sixthsense :) View Post
    show the format of your data is meant for the column / row references and sheet names of the data.
    It worked beautifully sixthsense. Thank you once again. But since my dataset is quite large, it took an awful amount of time just to get through one quarter of my list. But I have saved to code for future reference.

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Selecting rows in a table based on another list

    Glad it helps you and thanks for the feedback

+ 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