+ Reply to Thread
Results 1 to 8 of 8

UserForm Combobox Wild Search Filter based on first letter entry

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    UserForm Combobox Wild Search Filter based on first letter entry

    Good day,
    I am looking to modify my combobox from a userform to Filter the list based on the first entry on what the user will add.

    I have a code that will search for all entries in my "Control" sheet and passed this on to my combobox:

    Please Login or Register  to view this content.
    I have, within a module, the following function code that will help the user find the entry by adding the first 3 letters of the search they need:

    Please Login or Register  to view this content.
    I would like to know what to change in the function to filter the list, once the user adds a first letter and then press the dropdown from the combobox, to filter the list based on all entries from the first letter to only show entries with that letter.

    If A is entered, then, show only the entries strating with the starting letter A, but at the same time if the user adds more letter to filter to the first then second letter:

    If AB is inserted, then, show entries with AB only.

    Where do I add this code also, is this another function or this could be inserted within my function?
    Click the star icon in the lower left part of the contributor's post and add Reputation if we have helped you .

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    Without adding any other code, you can just change the MatchEntry property of combo 0- fmMatchEntryFirstLetter. This would show the possible option in the combobox field, and dropdown options will start showing from that option. Have a look at this and let us know if you still want to continue with question above.

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    Well The MatchEntry property of combo 0- fmMatchEntryFirstLetter doesn't allow other entry pass the first letter...My Function, you can add Letter 1, 2 and 3 and it will filter until the name is reached.
    What I was looking for is a filter like process.
    Example: If the letter A is entered in my combobox to show only a list with the entries starting with the letter A... If AB if inserted then drills down the list with entries found with AB....

    Adam 001
    Adam 002
    Apple 001
    Apple 002
    Banana 001
    Banana 002
    Orange 001
    Orange 002

    If A is inserted in the Combobox the list should only have the following list:

    Adam 001
    Adam 002
    Apple 001
    Apple 002

    If Ap is inserted in the Combobox the list should only have the following list:

    Apple 001
    Apple 002
    Last edited by Excelnoub; 06-18-2014 at 11:52 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    See if this one works for you.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    Works very good :D now will try to incorporate this in my workbook and let you know of my final code

    Thank you haripopuri

  6. #6
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    Glad I could help you. If you problem is solved, update the thread as solved and you may wish to add to my rep by clicking star at the bottom of each post.

  7. #7
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    I am just trying to bind your code to my UserFrom and maybe... Maybe try to add it as a function to the following:

    Please Login or Register  to view this content.
    PS: your rep has already been applied

  8. #8
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: UserForm Combobox Wild Search Filter based on first letter entry

    haripopuri,
    just to let you know that I have found something, I don't quite remember how I got it, but here is a sample workbook with a sort of search I was looking for

    I will try to change the listbox function to a ComboBox.

    WildCardListbox.xls

+ 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] VBA userform search for listbox entry based on Textbox value
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-12-2015, 08:29 AM
  2. [SOLVED] VBA Userform ComboBox: Content of ComboBox based off of Conditional Statement
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 03:00 PM
  3. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  4. Amending an entry based on userform search
    By hey1000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2010, 01:30 AM
  5. [SOLVED] Userform ComboBox entry disappearance problem
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2006, 11:10 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