Chapter Fourteen. Writing Procedures

Almost all of the VBA code you write will be contained in procedures. It's a pretty good idea, therefore, to know how to create procedures! A procedure is a section of code that has been assigned a name. When you need to execute that code, you refer to its name in your program. This is referred to as calling the procedure. Good programming practice dictates that the functionality of a program be broken up into relatively small and independent units of code, with each such “unit” contained in its own procedure. In this chapter, we will first look at the five different kinds of procedures that VBA supports, then learn the details of how to write your own.

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.