4. Using Procedures

Understanding Procedure Types

VBA code is organized into statements. A statement is a single line of code, for example:

intCount = 6

This statement sets the value of the intCount variable to 6. Although you can execute individual statements in the Immediate window, you can’t store individual statements in a VBA module. Within a module, statements must be organized into procedures: groups of statements that perform a task together. Although you’ve already seen a few procedures in the brief bits of code demonstrated in earlier chapters, this chapter ...

Get Business solutions Automating Microsoft 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.