Nicobisgaard60
New Member
- Joined
- Sep 4, 2016
- Messages
- 14
Hello,
I have a loop that runs for a long time, and when it meets a criteria i need it to stop the loop and continue on to the next part of the code.
The code starts with sheet 1, runs the macro and when the if-criteria is met, the formula stops and does not continue to the next sheets.
How do i rewrite the code so if the criteria is met, the code stops, only with that specific task and continues on to the next piece of code?
Just for clarification: I Posted this in another thread that was closed, so i apologize for that. I only use this code for peronal purposes, on workbooks that i created myself.
I have a loop that runs for a long time, and when it meets a criteria i need it to stop the loop and continue on to the next part of the code.
Code:
Sub InfiniteLoop()
For x = 1 To 4
Sheets(x).Select
For i = 1 To 9999999
If XXX = False Then
End
End If
Next i
Next x
End Sub
How do i rewrite the code so if the criteria is met, the code stops, only with that specific task and continues on to the next piece of code?
Just for clarification: I Posted this in another thread that was closed, so i apologize for that. I only use this code for peronal purposes, on workbooks that i created myself.