• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

How to exit For Next loop prematurely

How do I exit a For Next loop prematurely?
0
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
Jason EvansSenior Software DeveloperCommented:
Hi there.

You can use Exit For   eg:

For i = 1 To 10

 '// Do something....

Exit For '// Leave the For loop early.

 '// Do something else....
Next

Hope this helps.
Jas.
0
 
Tom KnowltonWeb developerAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now