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:

******************************************

******************************************

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 >>

Free! Subscribe To Our YouTube Channel!

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather
Tags: , , , , ,




 

Call Erik Now