+ Reply to Thread
Results 1 to 16 of 16

Lookup and return table values based on tab name

  1. #1
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Lookup and return table values based on tab name

    I have an interesting problem that I have been working on and am stuck at this point. I have a Master sheet with table values for various "methods". I also have 3 sheets named after these "methods" like "H", "E", and "O". In those sheets there are basic patient and QC info, such as the name and ID#. What I need help with is depending on what the tab name is, like "H", additional information that is contained in the master table needs to be pulled for the respective patients and QC that are present. To give a better picture of this, I have attached a file that has a few example methods (the red tabs) in their original form, and what they should look like after (green tabs) they gather information from the master (Black Tab). Help would be greatly appreciated.
    Master lookup question.xlsx

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    hi RaydenUK, option, please check attachment, press Run button on Master sheet or run code "test" (ALT+F8, select "test", press "Run" button)
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    Wow thank you watersev! Is there any way to make it just work on one sheet and not all the sheets. So if im on "H" then only run it for "H" and not the others. I should have been more specific, my apologies. But thank you so much for this.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    option, please check attachment, run code "test" while on any sheet except Master
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    That works but now only the patient values show up. Everything is still blank on everything else.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    you asked to process only currently active sheet data, it provides result for active sheet only

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    do I miss anything?

  8. #8
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    I discovered why... I actually have more information attached to the qc values than what the table has. For example "Q01QC1" may look like "Q01QC1_A_3_031515_2". So can the code flex to just recognize if the name is contained in the cells? Im sorry I realize I should have put that on the spreadsheet. This will be the last thing, I promise.

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    may I have a file sample? What is the delimiter to identify end of the code in the string like "Q01QC1_A_3_031515_2"?

  10. #10
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    This is what I should have sent to begin with. Sorry and thank you again for all your hard work.
    Master Lookup Question.xlsx

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    please check attachment
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    Genius. You did it once again!! Perfect! Thank you! Thank you! Thank you! I owe you tremendously.

  13. #13
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    Here is the file I had messaged you about watersev

    Master Lookup Question.xlsx

  14. #14
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    please check attachment
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Lookup and return table values based on tab name

    Watersev, how would i change this code if I wanted to have the "master" sheet on a different workbook with the path C:\Desktop\Master sheet only.xlsx?

  16. #16
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Lookup and return table values based on tab name

    please check attachment
    Attached Files Attached Files

+ 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. Replies: 0
    Last Post: 06-04-2014, 10:08 AM
  2. Trying to return value based on lookup in table
    By jnrexcel in forum Excel General
    Replies: 10
    Last Post: 05-31-2011, 09:00 AM
  3. lookup values in table, return sum of values from first column
    By owenkam in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-10-2010, 05:20 AM
  4. Return Values Based On Lookup Result
    By akbar in forum Excel General
    Replies: 2
    Last Post: 02-06-2008, 05:55 AM
  5. [SOLVED] return cell reference in a table based upon given lookup criteria
    By Travis in forum Excel General
    Replies: 3
    Last Post: 03-15-2006, 10:35 AM

Tags for this Thread

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