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]
You specify the start and end values for the counter, and by default, the code steps forward from less to greater.1
By using the “Step” keyword you can alter the increments, other than 1, the code moves forward through.1
You can also use the VBA For Loop in reverse by specifying “Step -1″1
Exit a VBA For Loop by using the Exit For statement.
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: