VBA For Loop

Use the VBA For Loop when you know how many iterations the code should make. Using this VBA For Loop will allow you to loop for a specific number of times.

Take a look at the video:

The syntax for the VBA For Loop is:

For counter= start To end [Step step]
Next counter

You specify the start and end values for the counter, and by default, the code steps forward from less to greater.


By using the “Step” keyword you can alter the increments, other than 1, the code moves forward through.


You can also use the VBA For Loop in reverse by specifying “Step -1”


Exit a VBA For Loop by using the Exit For statement.

<< VBA Do Loop | Recordset In VBA – PT1 >>

Sign Up For A FREE MS Access VBA Video Tutorial Subscription. You will get over 27 tutorial videos that will help you do your job better! Start Yours Now At:

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather
Tags: , , , , ,
Previous Post

Recordset In VBA – PT1

Next Post

VBA Do Loop

Leave a Reply