Solved

How to exit For Next loop prematurely

Posted on 2006-11-02
2
213 Views
Last Modified: 2010-04-23
How do I exit a For Next loop prematurely?
0
Comment
Question by:knowlton
2 Comments
 
LVL 10

Accepted Solution

by:
MrClyfar earned 500 total points
ID: 17859426
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
 
LVL 5

Author Comment

by:knowlton
ID: 17859453
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question