VBA Excel

While and Do Loops in VBA

The VBA while loop is used to execute the given statements as long as the condition is True. If the condition is false on first check, the execution moves out of the while loop.

For loop in Excel VBA

The VBA for loop is used to execute the group of statements for the given number of times. The for loop should be used if you know how many times a loop will run in advance.