+ Reply to Thread
Results 1 to 10 of 10

Search value in multiple sheets and return sheet name(s)

  1. #1
    Registered User
    Join Date
    11-20-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Search value in multiple sheets and return sheet name(s)

    Hi all,

    I have an Excel 2010 file which consists of 150+ sheets. I have 1 sheets which contains a column with values that could be in one or more of the other sheets.
    What I need is a script or function that searches the values in the column in all the other sheets and returns the name of the sheet or sheets where the value has been found.

    Any help is very welcome!

    Bart
    Last edited by evolv12; 11-21-2011 at 06:13 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Search value in multiple sheets and return sheet name(s)

    That description is very vague. You need to describe the layout of the other sheets and the location(s) where this "value" might be found. A workbook with several rows of sample values in column one of the source sheet and maybe two or three samples of the sheets to be searched.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    11-20-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Search value in multiple sheets and return sheet name(s)

    Here is an example of what I'm facing. The attached file contains an overview sheet with products and their locations and multiple sheets with products. I need a script or function that fills the location column on the overview sheet based on the sheets names that contain the product IDs.
    Attached Files Attached Files

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

    Re: Search value in multiple sheets and return sheet name(s)

    hi, evolv12, please check attachment, run code "test"
    Can it happen that product can be found on a multiple sheets or just one?
    Attached Files Attached Files
    Last edited by watersev; 11-21-2011 at 05:45 AM.

  5. #5
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Search value in multiple sheets and return sheet name(s)

    try this for start
    Please Login or Register  to view this content.
    Last edited by tom1977; 11-21-2011 at 06:46 AM.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

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

    Re: Search value in multiple sheets and return sheet name(s)

    if Product can be found on multiple sheets, it can be done this way around
    Attached Files Attached Files

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Search value in multiple sheets and return sheet name(s)

    Please Login or Register  to view this content.
    Last edited by snb; 11-21-2011 at 06:37 AM.



  8. #8
    Registered User
    Join Date
    11-20-2011
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Search value in multiple sheets and return sheet name(s)

    This works perfectly! Thank you so much!

  9. #9
    Registered User
    Join Date
    11-28-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Search value in multiple sheets and return sheet name(s)

    Sorry for bringing up a rather old thread, however I figured it would be better than starting a new one.

    The above excel spreadsheet posted by watersev was tremendously helpful, however I was hoping someone could explain how to tweek something slightly. In watersev's attachement, the code searches only for EXACT cell matches. I was hoping someone could guide me towards manipulating the code to find CONTAINS instead.

    For instance, I want a search for "BB" to return 104BB4 and BB243. In this worksheet, you would have to search for the exact term.

    Thank you!

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Search value in multiple sheets and return sheet name(s)

    Welcome to the Forum, mougiasm,

    unfortunately: Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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