Free templates
Meny Search Free templates

DO UNTIL loop in Excel (VBA and VB6) | Free code

Here you can download free code that shows how a DO UNTIL loop can be used for programming in Excel and VBA when you need to iterate through a data list of values until a condition is met.

A DO UNTIL loop is a statement in programming that is used to run the same code several times until a condition is met. The condition of a DO UNTIL loop can be specified at the beginning of the statement or at the end of the statement, a DO UNTIL loop begins with Do and ends with Loop.

If the condition of a DO UNTIL loop is placed at the beginning of the statement then it is not sure that the loop is executed even once, while it is certain that the loop executes at least once if the condition is placed at the end of the statement. A DO UNTIL loop can be stopped prematurely by using the "Exit Do" argument and this can be useful when, for example, a loop has reached the end of a data list.

In this template with free code for a DO UNTIL loop, we have constructed two identical loops in which one has the condition at the beginning of the loop while the other loop have the condition at the end of the loop.
Updated: 01-01-2015 | Created by All-templates.biz

Download DO UNTIL loop in Excel (VBA and VB6) | Free code ยป

Tags: excel iterations