Using a For...Next Loop

The For...Next type of loop allows you to run a group of statements repeatedly. It uses a counter to run statements a specified number of times. Following is an example that demonstrates the For...Next loop:

For variable = start To end

<statements to execute>

Next

You can exit early from a For...Next loop with the Exit For statement.