I created a filter combo box in excel, but when i try to filter it it shows me the filtered number and the complete data list below. How can I modify the code to only have applied the filtered data?. Is there also anyway to update the ComboBox info automatically and delete repeated data? Thank You.
This is the code that I am Using:
Private Sub ComboBox1_Change()
Dim i As Long
Dim sFind As String
sFind = Me.ComboBox1.Text
If Len(sFind) = 0 Then
Me.ListBox1.ListIndex = -1
Me.ListBox1.TopIndex = 0
Else
For i = 0 To Me.ListBox1.ListCount - 1
If UCase(Left(Me.ListBox1.List(i), Len(sFind))) = UCase(sFind) Then
Me.ListBox1.TopIndex = i
Me.ListBox1.ListIndex = i
Exit For
End If
Next i
End If
End Sub
Bookmarks