ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   exit for next loop (https://www.excelbanter.com/excel-programming/356946-exit-next-loop.html)

David Henderson

exit for next loop
 
Is there a command to "Exit" a for next loop ?
Thanks in advance
David

Values = False
Dim ofcells As Range
For Each ofcells In Range("myrange")
If ofcells.Value < 0 Then
Values = True
Can I exit loop from here

End If
Next
to carry on from here




John Jost

exit for next loop
 
I think it is "exit for"

"David Henderson" wrote:

Is there a command to "Exit" a for next loop ?
Thanks in advance
David

Values = False
Dim ofcells As Range
For Each ofcells In Range("myrange")
If ofcells.Value < 0 Then
Values = True
Can I exit loop from here

End If
Next
to carry on from here





Randy Harmelink

exit for next loop
 
Surprise! "Exit For" is the way to exit a FOR... statement group.



All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com