+ Reply to Thread
Results 1 to 6 of 6

Macro to search all worksheets and list those containing a certain text value

  1. #1
    Registered User
    Join Date
    04-11-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    58

    Macro to search all worksheets and list those containing a certain text value

    I've been trying to work on this for two days with little success. What I want is basically just a cut and paste option to the Find function. I want to search my 100+ worksheets for any instances of certain text- for example VOUCHER 6 (it will always be in row 3 if that matters) and give me a list of the worksheet titles.

    A huge bonus would be if there could be a third column that would return the data two cells above the words VOUCHER 6.

    So I would end up with a new worksheet called VOUCHER 6 (and then VOUCHER 7, VOUCHER 8 etc.) that looked like this:

    Farmer Name Total Coupons

    Farmer 1 456
    Farmer 2 24
    Farmer 3 1587

    Farmer 1 2 and 3 are the worksheet names and 456 24 and 1587 are the numbers two cells above the text VOUCHER 6 in each worksheet respectively. If anyone can help with this and/or point me in the right direction that would be amazing.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to search all worksheets and list those containing a certain text value

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    04-11-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    58

    Re: Macro to search all worksheets and list those containing a certain text value

    You are a genius! This worked perfectly!!! Is there any way to make the new sheet called VOUCHER 6 go at the end of all the other worksheets vs. at the beginning? If not, no biggie. Also, is there a way to set it to autototal all the numbers in the B column or not since we don't know how long it will be? Thanks a lot for the help.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to search all worksheets and list those containing a certain text value

    Done. Also, this code doesn't account for the possibility of more than one hit per sheet, but I could modify it for you if you want.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-11-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    58

    Re: Macro to search all worksheets and list those containing a certain text value

    Is there a way to modify it for that (that isn't too hard). I can manually add those but having them in the voucher would be amazing!

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to search all worksheets and list those containing a certain text value

    Please Login or Register  to view this content.

+ 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 for the text in cell A1 in a list and remove the text if found in the list
    By kak0 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-24-2014, 11:01 PM
  2. Replies: 3
    Last Post: 06-17-2013, 01:09 PM
  3. [SOLVED] Search text in cells, find matching text based on list, remove all but one entry
    By adam_mc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2013, 12:50 PM
  4. Search text in worksheets + copy to new sheet
    By stonegwene in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-23-2012, 02:21 PM
  5. 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
  6. How do I search a text string in many excel worksheets (files)?
    By TC628 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-07-2006, 08:15 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