Planning and Storing Procedures

The way you organize your code into procedures has a major influence on the structure of your project and also on how easy your code is to reuse, maintain, and debug. When planning how to create your procedures, the best rule to keep in mind is that each procedure should perform a single, discrete, and self-contained task. What the tasks are, of course, will be decided by the nature of your application. However, by breaking your code into procedures based on this rule you cannot go too far wrong.

For example, suppose your application needs to download some data from the Internet, perform some calculations on the data, then display the data on screen. Rather than include all this functionality in a single procedure, ...

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.