Microsoft Office Tutorials and References
In Depth Information
Saving a Macro to the Personal Macro Workbook
Playing back the macro is identical to our earlier macro example, with one difference:
before running this macro, we need to click precisely in the cell in which we want the
first line of the logo—Gidget’s Widgets—to appear. That’s because while our first macro
was programmed to start its logo-writing activity in cell A1—no matter where the cell
pointer happened to be at the macro’s outset—here, the Use Relative References
feature instructs the macro not to travel to a specific cell (A1), but rather to begin
wherever the cell pointer happens to find itself.
Thus, if you’re currently in cell L3 and click View Macros View Macros, click the macro
name ( Logo2 ), and click Run, the logo will appear in cells L3:L5. Click in a different cell
(say, B12), run the macro again, and the Gidget’s Widgets logo will install itself in
B12:B14.
Saving a Macro to the Personal Macro Workbook
Whenever you record a macro, it automatically makes itself available to any other open
workbooks, to be used there as well. Thus, if you’re working with the “Macro lesson”
workbook, and you open a second workbook and click View Macros View Macros
there, you’ll see the dialog shown in Figure 11–11.
Figure 11–11. The macros from the open “Macro lesson” workbook are usable in any other open workbook.
You can click Run and activate either of the macros shown in the figure, even as you’re
working in a different workbook.
But what if you want a macro to always be available to every workbook, without having
to actually open any other workbook in particular? You can make that happen by
recording macros and saving them to what’s called the Personal Macro Workbook , a
hidden workbook that opens whenever you access Excel. Any macro stored there can
be called upon by any other workbook that’s currently open. It works like this:
 
Search JabSto ::




Custom Search