VBA Tutorial Login  

Free! Excel VBA Online Tutorial


User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

Article Index


Excel VBA Loops, with examples. For Loop; Do While Loop; Do Until Loop.



Loops are one of the most basic and powerful programming tools in VBA, and used across most programming languages. Loops are used to repeat a block of code as many times as required, until a given condition remains true or a specific point (or value) is reached, after which the the next section of code is executed. A loop enables you to write a few simple lines of code and achieve a far more significant output, just by repetition.


There are three basic kinds of VBA Loops (subdivided into 6 loops as below):


The For Loop

The For … Next Statements

The For Each … Next Statements


The Do While Loop

The Do While … Loop Statements

The Do … Loop While Statements


The Do Until Loop

The Do Until … Loop Statements

The Do … Loop Until Statements




Bottom Ad

© 2014 GlobaliConnect.com. All rights reserved.