Consulting

Results 1 to 2 of 2

Thread: Smart Dropdown Search

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    Smart Dropdown Search

    I have a combobox and would like to know if/how I can make it locate the item by typing in any part of the item.
    So example:
    List of Items in Combobox
    Orlando Magic
    New York Knicks
    Los Angeles Lakers
    etc..

    I would like to be able to just type "Lakers"
    and it would pick "Los Angeles Lakers"

    Is this possible with a Combobox ??

  2. #2
    VBAX Regular Sixthsense..'s Avatar
    Joined
    Dec 2012
    Location
    India
    Posts
    15
    Location
    Try in this way...

    Dim vList As Variant
    Private Sub lbxListbox_Change()
        
    With Me.lbxListbox
        .List = Filter(vList, .Value, True, vbTextCompare)
        .DropDown
    End With
    
    End Sub
    
    Private Sub UserForm_Initialize()
        vList = Application.Transpose(ThisWorkbook.Sheets("Sheet1").Range("A2:A247").Value)
        lbxListbox.List = vList
    End Sub
    Attached a sample file for your easy reference.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •