Trying to change a textbox over to a combobox,thetextbox does a data search to find a name. I hope
a combobox would populate with more of the same names then narrow down to one. So if there was
six Jims it would show all until last name is typed in. Here is the code for the textbox all I changed was the textbox to combobox. Not
sure how to populate the comboBox? Attached is a workbook of what I would like to do.
Z
Private Sub ComboBox1_Change()
Dim arrList As Variant
With Me.ListBox2
.ListFillRange = vbNullString
.Clear
If Range("AB2").Value = True Then
'Search by Actor
arrList = Filter(Application.Transpose(Evaluate("if(isnumber(search(""" & Me.ComboBox1.Text & """,list_actors)),list_movies)")), False, False)
Else
'Search by Movie
arrList = Filter(Application.Transpose([list_movies].Value), Me.ComboBox1.Text, True, vbTextCompare)
End If
If IsArray(arrList) Then
.List = arrList
Else
If InStr(1, arrList, Me.ComboBox1.Text, vbTextCompare) Then .AddItem arrList
End If
End With
If IsArray(arrList) Then Erase arrList
If ListBox2.ListCount <> 0 Then
ListBox2.Selected(o) = True
Else
Range("J9").ClearContents
End If
End Sub
Bookmarks