VBE313
Well-known Member
- Joined
- Mar 22, 2019
- Messages
- 686
- Office Version
- 365
- Platform
- Windows
Private Sub CommandButton1_Click()
For I = 0 To Me.ListBox4.ListCount - 1
If InStr(UCase(ListBox4.List(I, 1)), UCase(sFind)) > 0 Then
Me.ListBox4.TopIndex = I + 1
Me.ListBox4.ListIndex = I + 1
Exit For
End If
Next I
End Sub
How can I replace the "I + 1" with a variable to add 1 after every click?
For I = 0 To Me.ListBox4.ListCount - 1
If InStr(UCase(ListBox4.List(I, 1)), UCase(sFind)) > 0 Then
Me.ListBox4.TopIndex = I + 1
Me.ListBox4.ListIndex = I + 1
Exit For
End If
Next I
End Sub
How can I replace the "I + 1" with a variable to add 1 after every click?