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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
VBA procedures and message boxes5m 26s
-
(Locked)
Automate Excel with For...Next loops and Copilot9m 29s
-
(Locked)
Using Do While or Do Until loops8m 13s
-
(Locked)
Calling macros to run in sequence6m 17s
-
(Locked)
Capture input for macros6m 41s
-
(Locked)
Automate sheet styling with For...Next loops5m 52s
-
(Locked)
Challenge: Building a macro that asks for user input26s
-
(Locked)
Solution: Building a macro that asks for user input2m 49s
-
(Locked)
-
-
-
-