I created a filter combo box in excel to search data 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 so that it only shows 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 ThenMe.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
I am also sending an attachment of the excel file , it is located at developer, visual basic
Bookmarks