In this chapter, you will learn to:
Record and run a macro.
Understand and edit simple recorded macros.
Run a macro by using a shortcut key.
Manage macro security.
A couple of weeks ago, I misplaced the remote control to my digital video recorder.
It was awful. I was trying to watch a perfectly legal, fair-use, time-shifted episode of Desperate Housewives, but I couldn’t because the navigation controls are built into the remote control. Fortunately, when I was getting a fresh bag of popcorn from a cupboard in the kitchen a few days later, I discovered where I had set the remote. I’m so happy that I can again watch pre-recorded television. Not to mention changing the channel without having to stand up.
Microsoft Visual Basic for Applications (VBA) is the remote control for Microsoft Office Excel 2007. Sure, you can use Excel without ever using VBA, but the VBA remote control makes Excel more convenient to use. It also allows you to take advantage of features that can’t be accessed through the standard user interface. Once you become acquainted with VBA, you’ll wonder how you ever got along without it.
|On The CD-Important|| |
Before you complete this chapter, you need to install the practice files from the book’s companion CD to their default locations. See “Using the Book’s CD” on page xv for more information.
USE the Budget.xlsx workbook. This practice file is located in the Documents\MSP\ ExcelVBA07SBS folder. The workbook contains a single worksheet, named Budget. This worksheet includes a projected month-to-month budget for the year 2007.
BE SURE TO save the Budget.xlsx workbook with the name Chapter01 in a new folder called Work. You put the workbook in a new folder so that you can be absolutely certain that nothing is in the folder except files that you put there. Later, this will allow you to trust any macro workbooks in that folder.
OPEN the Chapter01.xlsx workbook.