A key-press macro requires the user to press a hot key each time it runs. In many situations, you would like a macro to repeat a sequence of steps until all of the records are processed, whether the records are few or many. This is a perfect place to use a loop. Watch these videos on loops and then skim the reading below to make sure you've learned each concept. In the videos below, we show you two main forms of looping (Do and For), each with a couple variations. Each type of loop is better suited to certain situations, although any type of loop can be used for nearly any type of situation (it just might not be the "best" way to code it). In this class, you are welcome to have a "favorite" loop type and just use that one everywhere.
The Do Until loop executes until something is true as follows:
Do Until [Condition = True]
The figure below shows a sub routine using the Do Until loop.