+ Reply to Thread
Results 1 to 4 of 4

Search Worksheet Using ComboBox & Show Results in Different Worksheet

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    29

    Search Worksheet Using ComboBox & Show Results in Different Worksheet

    Hi All

    Heres hoping someone can point me in the right direction. I am trying to find a way of searching a worksheet ( Sheet1 for example ) which has hundreds & hundreds of rows of data entered into it from a userform. I would like to be able to search this worksheet using a userform with a ComboBox and command button and the results returned are shown in Sheet2 From Range A1:E1. Basicaly i am trying to turn the userform into a auto filter because there will be hundreds of duplicates in the combobox which is why i do not want to set the "ROWSOURCE" to column A if that makes any sense.

    I have attached an example of what i am trying to achieve.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Search Worksheet Using ComboBox & Show Results in Different Worksheet

    See how this works out for you. The code behind the form includes a call to a sub in the inialize event and on the submit button click event.

    ComboSortSend.xlsm

    Please Login or Register  to view this content.
    These are calls to the following, which create a unique list of values from Column A and loads them into the combobox, and then, upon submit, loops through the worksheet sending matches to Sheet2.

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-16-2011
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Search Worksheet Using ComboBox & Show Results in Different Worksheet

    Thank you very much for the speedy response

    That works perfectly and is exactly what i was trying to achieve. I don't fully understand how it all works but can make sense of some of it. Would i be able to do this by having a textbox where the user would make an entry and search ? ( or do i need to start a new thread )

    Thanks again
    regards MIFF3436

  4. #4
    Registered User
    Join Date
    11-20-2012
    Location
    STAFFORD
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Search Worksheet Using ComboBox & Show Results in Different Worksheet

    hi can some one help i have use this code for my project the only thing is diffenet i am searing by towns in the work sheet but every time i click on the town and click seach get an error message this part of the code not working

    Please Login or Register  to view this content.
    in my data i am doing a search using town eg Stafford, in my list are in vendars that bace in Stafford i would like it goto sheet 2

    thank you

+ 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