+ Reply to Thread
Results 1 to 4 of 4

How do you search through multiple sheets to find a specific value?

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    How do you search through multiple sheets to find a specific value?

    Hi

    I was wondering if somebody could help me with some code that I have adapted for searching for a specific name within a worksheet and if found then copying and pasting cell values around the found name into specific cells. My problem is that I would like to know how to search through all the sheets within the workbook. In my case there will only ever be 3 worksheets (sheets2,3 and 4) to search in, sheet1 will be for the copied data.

    Here is a bit more detail:
    The variable can either be on sheets2,sheets3 or sheets4 and will either appear once (throughout the workbook) or not at all, if not found then a message box saying "I could not find variable” pops up or if it found specific cells around the variable are copied to sheet1 into specific cells (always the same cells)
    This my code :
    Please Login or Register  to view this content.
    Thanks for looking

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: How do you search through multiple sheets to find a specific value?

    See if this works:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How do you search through multiple sheets to find a specific value?

    I generally loop through the sheets in book:

    Please Login or Register  to view this content.
    Untested, so may take a little bug-fixing.

  4. #4
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How do you search through multiple sheets to find a specific value?

    Thank you StephenR and Andrew-R. I have tested both sets of code and both work really well. Thanks for helping me out, I can now continue

+ 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