vba break out of loop code example
Example: vba for break
Dim i As Integer
For i = 0 To 10
If i > 5 Then
Debug.Print "Exit."
Exit For
End If
Next i
Dim i As Integer
For i = 0 To 10
If i > 5 Then
Debug.Print "Exit."
Exit For
End If
Next i