goldenvision
Board Regular
- Joined
- Jan 13, 2004
- Messages
- 234
I am running the code below to select a record in a list box on a userform then search through records until a match is found and mark the matched record with an "x". However the code seems to be stopping part way through and I can't figure out why. Any help would be greatly appreciated. (Code marked with comments below)
Code:
Private Sub lst_DeleteLeaveRequest_Click()
Dim i As Long, x
Dim leaveID As Integer
Dim rowCount As Integer
rowCount = 1
With Me.lst_DeleteLeaveRequest
For i = 0 To .ListCount - 1
If .Selected(i) Then
leaveID = .List(i, 0)
MsgBox leaveID
End If
Next
End With
'++++THIS IS THE POINT WHERE THE CODE STOPS++++
Do Until Cells(rowCount, 1) = ""
If Cells(rowCount, 1).Value = leaveID Then
Cells(rowCount, 6).Value = "x"
Else
End If
rowCount = rowCount + 1
Loop
End Sub