O'Reilly logo

Business Solutions VBA and Macros for Microsoft by Tracy Syrstad, Bill Jelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Looping and Flow Control

IN THIS CHAPTER

Loops are a fundamental component of any programming language. If you’ve taken any programming classes, even BASIC, you’ve likely encountered a For...Next loop. Luckily, VBA supports all the usual loops, plus a special loop that is excellent to use with VBA.

This chapter covers the basic loop constructs:

  • For...Next

  • Do...While

  • Do...Until

  • While...Loop

  • Until...Loop

We also discuss the cool loop construct unique to object-oriented languages:

  • For Each...Next

For...Next Loops

For and Next are common loop constructs. Everything between For and Next is run multiple times. Each time that the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required