Loop statements

Loop statements repeat a block of script steps a specific number of times or while a condition is true or false.

Statement Description
Do...Loop Until Repeats a block of statements as long as a condition is False or until an Exit Do statement runs.
Do...Loop While Repeats a block of statements as long as a condition is True or until an Exit Do statement runs. The condition is evaluated at the end of the loop.
For Each...Next Repeats a block of statements once for each element in a group, such as an array. Not available in the Add Statement dialog box.
For...Next Repeats a block of statements a specified number of times or until an Exit For statement runs.
While Repeats a block of statements as long as a condition is True or until an Exit While statement runs. The condition is evaluated at the beginning of the loop.