+ Reply to Thread
Results 1 to 6 of 6

Userfrom to search multiple critera and have partial matches.

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

    Userfrom to search multiple critera and have partial matches.

    Hi,

    In the attached excel form I have set up a userform to search my data which is set up perfectly except it does not narrow down the results by multiple criteria. I would like to change it so that the results that show match all the filled in criteria (which can be any combination of category, product, company and/or location). So if I fill all the fields in on my userform the search result has to match all of the inputs. Also with the "company" criteria it would be great if it could work with a partial match so maybe a search box would work better than a dropdown for this criteria.

    Any help would be much appreciated as I'm very new to VBA and have little experience.

    Thank You
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Userfrom to search multiple critera and have partial matches.

    what are the values in your code called UBDand and Dand? they have no declarations. plus, when searching in your form, the code breaks on Dand.Value. see images.
    Attached Images Attached Images

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

    Re: Userfrom to search multiple critera and have partial matches.

    Apologies, they are redundant. The dropdowns used to be combined with option buttons and text boxes to create a more advanced search but I didn't need them for what I am trying to achieve. So the 3 you mention refer to option buttons that are no longer there. I should have deleted that part of the code apologies.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Userfrom to search multiple critera and have partial matches.

    can you repair the code so it runs with no errors then?

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

    Re: Userfrom to search multiple critera and have partial matches.

    If you are only searching on your database use the database content to populate the comboboxes.
    In this manner you are only searching for items that exist - there is no need for separate listings.
    The combos feed only those items relevant to the preceding search and only contain uniques not duplicates of entire listing.
    Start from the left as each combo loads the next to the right - on dismissing the form it will transfer the selection to the second listing.
    A hidden sheet keeps track of the filtered listbox.
    torachan.
    Attached Files Attached Files

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

    Re: Userfrom to search multiple critera and have partial matches.

    Ah That works thank you!

+ 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] Multiple critera / Partial match lookup
    By johnmitch38 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-04-2019, 01:09 PM
  2. [SOLVED] vlookup with multiple partial matches
    By richx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2019, 11:23 AM
  3. [SOLVED] Partial matches for a teext string being used to search an array
    By Brycicle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2018, 04:50 PM
  4. Replies: 19
    Last Post: 06-08-2017, 07:24 AM
  5. If multiple critera matches then return value
    By lordcut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2016, 07:35 AM
  6. [SOLVED] Multiple partial matches
    By Grinfactor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-28-2014, 01:15 PM
  7. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 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