+ Reply to Thread
Results 1 to 3 of 3

VBA Userform to search data in a table filtering results based on all search criteria

  1. #1
    Registered User
    Join Date
    11-04-2020
    Location
    england
    MS-Off Ver
    2019
    Posts
    7

    VBA Userform to search data in a table filtering results based on all search criteria

    Hi,

    Im very new to VBA and userforms so I am struggling with the following

    I have a userform that searches the data in my table however it only searches based on the last dropdown option that is selected. So in this case "Location". Id like to change it so that the results only show if they match all the selected criteria. (For example if I select a "Product / Service" and a "Location" the results only show if they match both not just the last one.

    Thank You, (I have attached the workbook for reference)
    Last edited by matt7416; 11-05-2020 at 10:40 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,309

    Re: VBA Userform to search data in a table filtering results based on all search criteria

    alternative method - primary search is done by comboboxes - secondary search done by choice from listbox.
    the comboboxes only contain one of each item if multiples - however the choice places all in the listbox.
    torachan.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-04-2020
    Location
    england
    MS-Off Ver
    2019
    Posts
    7

    Re: VBA Userform to search data in a table filtering results based on all search criteria

    Quote Originally Posted by torachan View Post
    alternative method - primary search is done by comboboxes - secondary search done by choice from listbox.
    the comboboxes only contain one of each item if multiples - however the choice places all in the listbox.
    torachan.
    Thank You, This is something I wanted to do so helps massively but what I meant originally is to have it so that I can filter the results by more than 1 of the comboboxes. So I can narrow down the results by first choosing a category then choosing 1 or more of the other comboboxes and the result that appear in the main list box have to match all of the choices in whichever combo boxes have been filled in.

    But thank you, the change you have made is something I was going to look at once I had fixed my problem above

    EDIT: I have managed to solve it, Thanks again.
    Last edited by matt7416; 11-05-2020 at 10:41 AM.

+ 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. search formula for several results with 3 search criteria
    By proxima centauri in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-30-2020, 10:42 AM
  2. Userform Search when search two text boxes return multiple results
    By nekiwa07 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2020, 09:42 AM
  3. Search sheet and place results into a list box based on criteria
    By San75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2019, 03:50 AM
  4. [SOLVED] VBA to Search and List Results Based on specified Criteria
    By Bigred251 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2016, 12:51 PM
  5. Replies: 1
    Last Post: 12-14-2015, 07:10 PM
  6. Userform To search based on 2 criteria Help
    By MDJ666 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2013, 09:29 AM

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