PDA

View Full Version : Smart Dropdown Search



Emoncada
06-04-2015, 06:19 AM
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 ??

Sixthsense..
06-04-2015, 10:01 PM
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.