+ Reply to Thread
Results 1 to 4 of 4

Return search results??

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Return search results??

    I've got an excel spreadsheet with almost 300 (!) worksheets. I want to use a formula (or a macro) which lists which worksheets a certain search query is found in. So for example "Grass" is found in 8 worksheets, and this formula should produce the list D0100, D0105, D0106, D0109, D0111, D01A, D01B, F10300 (the names of the worksheets separated by commas - of course without displaying the same worksheet twice)

    Is this possible?

  2. #2
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Return search results??

    Is the word "Grass" in the same cell each time, or randomly placed throughout?

    It can be done...but it is going to drag your computer down with that many sheets having to search all cells....

  3. #3
    Registered User
    Join Date
    09-02-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Return search results??

    No it's randomly placed....

    It's easy to do manually, but would just take for ever, so I guess as long as my computer doesn't crash, it'll be worth it...

  4. #4
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Return search results??

    My suggestion would be to close this thread out and post/move it to VBA/Macro Forums... make sure to delete first or Mod's will get you.

    They should be able to help with a macro...it will need 2 loops... hopefully "Grass" is at least in the same column in each sheet. You may have to put the worksheet name someplace in each sheet, else only be able to return the sheet # not the tab name, which I don't believe is availible.

    The firt loop will be

    For each worksheet in Worksheets
    For each cell in Range
    If Cell.value = "Grass"
    Then myString = MyString + "," + WorkbookNumber/Name
    End
    End
    End

    My VB is to shaky to write it all out personally. I would also recommend doing a search of the forums, or google VB + Search for value

+ 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