hi,
the excel was crashing when the values i type in the textbox are not found. kindly please provide an additional code to avoid it from crashing when the values are not found.
txtSearch = the textbox that will initiate the searching in the listbox while typing.
lstbox = the listbox that contains the data with 7 columns
Private Sub txtSearch_Change()
Dim i As Long
Dim c As Long
Dim Str As String
Str = Me.txtSearch.Text
For i = 0 To Me.lstbox.ListCount - 1
For c = 0 To Me.lstbox.ColumnCount - 1
If LCase(Me.lstbox.List(i, c)) Like LCase(Str) & "*" Then
Me.lstbox.ListIndex = i
Exit Sub
End If
Next c
Next i
End Sub
Thanks & Regards,
Bookmarks