I may be shooting for the mirror here, but some of my dependent drop boxes have 100+ options in it, so it would be nice to be able to have a search function when using the form's drop down menu without the user having to click on the drop down menu and then start typing - its very counterintuitive to the people who have tested my sheet so far. All of the searchable drop box solutions I found don't use dependent lists, and I can't find a way to make them work with the way I have it set up.
Is there a VBA solution to make the employee drop box searchable with the way I have my dependent drop lists set up? Do I need to start over and try to come up with a pure VBA solution? What would be best at this point?
Searchable Box.JPG
Since I can't upload the sheet (I keep getting an upload failed notice), here is the code:
Private Sub cboEmp_DropButtonClick()
Select Case txtDIR.Value
Case Is = "OOC"
cboEmp.RowSource = "OOC"
Case Is = "RM"
cboEmp.RowSource = "RM"
Case Is = "GM"
cboEmp.RowSource = "GM"
End Select
End Sub
I am playing with something like this from StackOverflow, but I seem to be misapplying it:
Public Sub FilterComboBox1(strFilter As String)
If Sheet1.ComboBox1.ListIndex > -1 Then
Else
Sheet1.ComboBox1.Clear
For Each strchoice In colChoices
If InStr(1, strchoice, strFilter) <> 0 Then
Sheet1.ComboBox1.AddItem strchoice
End If
Next
End If
End Sub
I also found some autocomplete ones, but I am not sure where to put them with the Case/Select functions:
comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
Bookmarks