I used OnKeyUp so while user is typing, it is searching in the list view. I am getting an error with my code.
"Wrong number of arguments or invalid property assignment"
Here is my code below:
Private Sub txtEmailGenSearch_KeyUp(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
Dim strText As String
Dim i As Long
strText = LCase(txtSearch.value)
With MainForm.lstMailGen
For i = 0 To .ListItems.count - 1
If LCase(Left(.ListItems(i, 0), Len(strText))) = strText Then
Exit For
Next i
If i = .ListItems.count Then
' No matching item was found, select nothing
.ListIndex = -1
Else
' A match was found, select it
.ListIndex = i
End If
End With
End Sub
If LCase … Thenstatement has noEnd If