From the course: Excel: Macros in Depth

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Using Do While or Do Until loops

Using Do While or Do Until loops - Microsoft Excel Tutorial

From the course: Excel: Macros in Depth

Using Do While or Do Until loops

- [Instructor] Working with loops can be an easy way to execute code that loops through your spreadsheet. It can add calculations, set the values, format, you name it. It will loop the code until it meets a condition or doesn't. This is where do while and do until come into play with your solutions. Do while is used in programming to repeatedly execute a block of code while a condition is true, and it will stop as soon as the condition is false. Do until repeatedly executes a block of code until a condition is true. Do while and do until really can be used interchangeably depending on your situation. It really comes down to the solution you're working with and also your ability to create the condition that's either true or false. One thing to note is do while might fail the loop if the first condition is false, but do until checks the condition after the loop, so it will always run at least once. Now these are programming concepts, so don't sweat it. It's likely in Excel you can use…

Contents