+ Reply to Thread
Results 1 to 7 of 7

Creating an advanced search/find function

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Creating an advanced search/find function

    I am trying create an advanced search function in Excel. I don't know if this is even possible. I have a spreadsheet with 30-40 tabs. On a daily basis, users need to search for account numbers or client names. For any given account/name, each may show up in one tab or multiple tabs.

    I have tried using the "find" function in excel, but it is only limited to one tab at a time (I know if you select all tabs, excel will search all, but some of the users of spreadsheet are not savy enough to use this and I don't want to go this route)

    There are two ways I am trying: I prefer option 1.

    Option 1: create a function similar to what Excel has for searching key words in a document but expand to look at multiple tabs.

    Option 2: create a message box that would ask the user "Enter search criteria." Macro would then search and return results in same box. For example if search for word "Smith", macro would display message such as: "Smith found in: tab05, tab12, tab22, tab48".

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Here is a sample workbook and some links to similar threads
    Enter one of these numbers to find and click the button:
    8045020
    8045007
    8044994
    8045013
    8045911
    8045026
    The code will then filter through sheet 2 in one column for the number requested and paste it to sheet 3, then then go to sheet 1 and filter from a different column and paste it to sheet three,
    http://www.excelforum.com/showthread.php?t=590888

    Hopefully you can get some ideas from there
    Last edited by davesexcel; 02-02-2008 at 01:17 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173
    Thanks for the link but not quite what I am looking for. I don't want to create an additional sheet that displays the information. Also, the example in the thread attached is only for "exact" matches. I need it to work for "partial" matches. For example: search for any 5-digit zip code that begins with "100".

    The marco would start the search with tab01. If "100" is found in tab01 then that cell would be highlighted. If the use wishes to continue then user would click on next. Macro would then search in tab02, then tab03, then tab04, and so on until last tab is reached.

    I want the Macro to work just like the find function in Excel (or Adobe).

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Quote Originally Posted by maacmaac
    Thanks for the link but not quite what I am looking for. I don't want to create an additional sheet that displays the information. Also, the example in the thread attached is only for "exact" matches. I need it to work for "partial" matches. For example: search for any 5-digit zip code that begins with "100".

    The marco would start the search with tab01. If "100" is found in tab01 then that cell would be highlighted. If the use wishes to continue then user would click on next. Macro would then search in tab02, then tab03, then tab04, and so on until last tab is reached.

    I want the Macro to work just like the find function in Excel (or Adobe).
    Woops, I read find and diffrent sheets and my mind automtically thought of that thread

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I have tried using the "find" function in excel, but it is only limited to one tab at a time
    That's not true. In the Find dialog, click Options, then in the Within drop-down, select Workbook, then click Find All.

  6. #6
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173
    I can't use the find all function as per previous thread as our company is using Excel 2000 and it is not available.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You could create a UserForm to select the account number in. Then use .Find to search. This could be doen for each sheet by using a For...Next loop. The results could be displayed in a Listbox on the form. see the databaseform example here to start.

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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