+ Reply to Thread
Results 1 to 6 of 6

How to search all worksheets?

  1. #1
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    How to search all worksheets?

    Hi,

    I have a userform that searches for data from my 2017 sheet.

    I now have a 2018 sheet and I would like to use the same userform to search both sheets and in a years time be able to search 2019 sheet and so on...

    I have asked for help on another forum so here is the link to that:
    https://www.mrexcel.com/forum/excel-...stead-one.html

    Any help would be much appreciated.

    Thanks

    Dan
    Attached Files Attached Files

  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: How to search all worksheets?

    Replace your CommandButton1_Click code with the below one.

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


    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
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: How to search all worksheets?

    Hi Sixthsense,

    Thank you for your reply.

    You code is partly there.

    When I enter a 2018 number into the search when on the 2017 worksheet. Your code finds the correct data in the listbox but when I select that data in the listbox it shows different data on the right in the green area.

    Any further help would be appreciated.

    Thanks again

    Dan

  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: How to search all worksheets?

    Change in code's.

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

  5. #5
    Forum Contributor
    Join Date
    10-25-2016
    Location
    Derby, England
    MS-Off Ver
    MS 2013
    Posts
    228

    Re: How to search all worksheets?

    Thank you so much Sixthsense it's brilliant.

    Will this code work now no matter how many sheets I create in future?

    Thanks again for your help.

    Regards

    Dan

  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: How to search all worksheets?

    Quote Originally Posted by danbates View Post
    Will this code work now no matter how many sheets I create in future?
    Yes, it will work in all (future) sheets of that workbook.

+ 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. [SOLVED] Search multiple worksheets for search term and paste results in a summary sheet
    By Andy15 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-03-2017, 01:49 PM
  2. Search throughout different worksheets.
    By kordomegon in forum Excel General
    Replies: 2
    Last Post: 07-25-2014, 09:40 AM
  3. [SOLVED] Search box in Excel to search key words in sentences in multiple worksheets
    By fernandoii676 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2012, 01:42 PM
  4. Replies: 2
    Last Post: 10-19-2012, 11:11 AM
  5. Replies: 9
    Last Post: 01-22-2012, 01:31 PM
  6. Search Multiple Worksheets Against List of Non-Exact Search Criteria?
    By thump4r in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 03:46 PM
  7. Search one cell in all worksheets, return worksheets
    By GaryMallin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2010, 12:37 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