Greetings, I'm seeking assistance to understand why the code below jumps out of the loop after assigning the cboSprint.Text value. Then resumes the loop at Exit For upon returning from cboSprint_Change() sub.
I've read other posts that suggest inserting Application.EnableEvents = False, or
Application.Calculation = xlCalculationManual statements, but neither failed to contain the code within CurSprintDate().
Private Sub CurSprintDate()
Dim rRow As Range
Dim iCount As Integer
iCount = 0
For Each rRow In rSprintDates 'Retrieved from rSprintDates (range $B$2:$B$28) public variable
iCount = iCount + 1
If Date <= rRow.Value Then
cboSprint.Text = cboSprint.List(iCount - 1) 'cboSprint.Text is assigned the correct value but then immediately jumps to cboSprint_Change() sub
Exit For 'the code resumes here after exiting cboSprint_Change() sub
End If
Next rRow
End Sub
Please help me understand what is causing this behavior.
I've read other posts that suggest inserting Application.EnableEvents = False, or
Application.Calculation = xlCalculationManual statements, but neither failed to contain the code within CurSprintDate().
Private Sub CurSprintDate()
Dim rRow As Range
Dim iCount As Integer
iCount = 0
For Each rRow In rSprintDates 'Retrieved from rSprintDates (range $B$2:$B$28) public variable
iCount = iCount + 1
If Date <= rRow.Value Then
cboSprint.Text = cboSprint.List(iCount - 1) 'cboSprint.Text is assigned the correct value but then immediately jumps to cboSprint_Change() sub
Exit For 'the code resumes here after exiting cboSprint_Change() sub
End If
Next rRow
End Sub
Please help me understand what is causing this behavior.