Divide and Conquer
The secret to creating a macro capable of handling a long, intricate project is to break the project into small pieces, create a macro for each piece, and then glue the pieces together. If you just turn on the recorder, carry out 400 steps, and cross your fingers hoping for the best, you have about a 1-in-400 chance of having your macro work properly. Let's look at a hypothetical example.
As the bookkeeper at The Garden Company, you have an elaborate month-end project you'd like to automate so that you can delegate it to subordinates when you go on vacation. You get a monthly summary report of orders for the previous month from the order- processing system.
The report shows sales information for each combination of state, channel, price range, and category. The order-processing system exports the report as a text file. You prepare the file and add the new month's orders to a cumulative order-history database.
This chapter shows you how to record the tasks that make up this large, complex project and then combine these small macros into one comprehensive macro. Along the way, you might learn some useful techniques for completing everyday tasks as well.