+ Reply to Thread
Results 1 to 5 of 5

Combobox droplist showing only options contining the text entered (suggetsions)

  1. #1
    Registered User
    Join Date
    07-14-2020
    Location
    Melbourne, Australia
    MS-Off Ver
    Prof Plus 2013
    Posts
    4

    Question Combobox droplist showing only options contining the text entered (suggetsions)

    Hi, I'm still fairly new to VBA and I'm looking for some code that can help me on a combobox droplist. I could fins code that only does parts of the requirement.

    I have an Activex COmbobox (Not userform) that has a predefined listfillrange. When I start to enter in the combobox, I want the droplist to only show results form the listfillrange than contains the text entered. Note, not starting with that text, but containing that text anywher in the string of each value in the listfillrange.

    Example:
    Lets say my range is:
    October
    november
    bergkamp
    Octopus

    When I start typing "o" the droplist should be visible only showing the 3 options that has an "o" in them regardless of their position. When I continue to type and add the "c" (I.e. "oc" in the field), it will now only show "october" & "octopus". Same if I enter "ber" it should show "october", "november" & "bergkamp" as options. When adding a "g" (I.e "Berg") it should now only show the 1 remaining match option.

    I should then be able to key down and enter or select with mouse. Then press tab to take me to another combobox.

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

    Re: Combobox droplist showing only options contining the text entered (suggetsions)

    I believe the attached will do what you are seeking.
    However before getting into bad habits I would urge you to read the pitfalls of using ActiveX directly on a sheet.
    Their positioning especially can be unstable - far better to use them on a UserForm as intended.
    Note if on a sheet ensure they are totally contained within a single cell.
    torachan.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-14-2020
    Location
    Melbourne, Australia
    MS-Off Ver
    Prof Plus 2013
    Posts
    4

    Re: Combobox droplist showing only options contining the text entered (suggetsions)

    Thank! Exactly what I was looking for

  4. #4
    Registered User
    Join Date
    07-14-2020
    Location
    Melbourne, Australia
    MS-Off Ver
    Prof Plus 2013
    Posts
    4

    Re: Combobox droplist showing only options contining the text entered (suggetsions)

    I'm stuck again Appreciate that I'm a beginner. I've used the file you shared as base, then replaced the data range on sheet2 with my own. I'll have 3 combobox setup on 1 sheet. I therefor change the combobox1 name to "Soldto" I also changed Sheet1 --> "Main" and Sheet2 --> "Customers". I've triedAttachment 688482 to manipulate it a little, but i'm getting error messages: "Compile Error: Method or Data member not found".

    My data source sheet also have duplicates. Any easy way to only show unique values in the droplist?

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

    Re: Combobox droplist showing only options contining the text entered (suggetsions)

    The attachment is invalid - ill not open.
    The paperclip attachment method does not work.
    Follow the instructions in the big yellow banner at the head of the page - how to upload a workbook.

+ 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] Showing Text in a Pivot Table - expanding the amount of options.
    By Jwilf in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-07-2016, 10:38 AM
  2. Replies: 2
    Last Post: 09-04-2015, 01:59 PM
  3. [SOLVED] Searching for text matches and showing results in ComboBox
    By tonygg9 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-13-2014, 09:58 AM
  4. Showing the last entered text in a cell
    By MattBenton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 07:47 AM
  5. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  6. How to link Droplist options with Graphs
    By PuckBunny in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-27-2009, 06:13 AM
  7. Dependant Droplist showing distinct records
    By andrew37_37 in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 09-06-2005, 09:05 PM

Tags for this Thread

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