Question : how to exit a for loop vba
Answered by : sam-layton
Sub Exit_For_Loop() Dim i as integer For i = 0 To 9 If i = 4 Then MsgBox ("The value is i is : " & i) Exit For End If Next
End Sub
Source : https://www.tutorialspoint.com/vba/vba_exit_for_statement.htm | Last Update : Thu, 21 Jul 22