The Secondary Procedures

The plan is to write one secondary procedure to handle each of the three worksheets. Let's start with the worksheet that will display monthly sales, by category, for the past 12 months. By “past 12 months,” I mean the 12 most recent completed months. Thus, if the worksheet is opened sometime during November of 2001, it will display data for the months November 2000 through October 2001.

The procedure will have to calculate 24 totals: the two categories, Software and Hardware, for each of the 12 months. An ideal way to store this data is in a 12 × 2 element array. By increasing the array size to 12 × 3, we will have an extra element for each month's index.

The first task of the procedure is to determine the starting and ...

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.