I would like to exit my for loop when a condition inside is met. How could I exit my for loop when the if condition has been met? I th
for
if
Another way to exit a For loop early is by changing the loop counter:
For i = 1 To 10 If i = 5 Then i = 10 Next i Debug.Print i '11
For i = 1 To 10 If i = 5 Then Exit For Next i Debug.Print i '5