Chapter Thirteen. Conditional and Loop Statements

An important part of VBA programming has to do with program control. It is not sufficient to simply write the code that performs the required tasks—you must also control which code is executed, when it is executed, and how many times it is executed. Conditional statements control which code is executed. Defined blocks of code may be executed, or not executed, based on conditions in the program as it is executing. Loop statements execute blocks of code zero, one, or more times as required. You'll see that VBA provides you with complete control over code execution, using the statements covered in this chapter.

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.