Page 742 - Excel 2013 All-in-One For Dummies
P. 742

724 Using the Visual Basic Editor
 To open a module in the Code window, double-click its module icon in the Project Explorer or right-click the module icon and then choose View Code at the top of its shortcut menu.
If you want to rename a module in your VBA project to something a little more descriptive than Module1, Module2, and so on, you can do this in the Properties window that appears immediately below the Project Explorer. Simply click and drag through the name (such as Module1 or Module2)
that appears after the label (Name) on the Alphabetic tab in the Properties window and replace it with a more descriptive name before you press Enter. When renaming a module, remember that you must use the same naming guidelines as when naming a range name in a worksheet: Begin the module name with a letter of the alphabet and don’t put any spaces between words. (Use underlines instead.)
Editing recorded macros
After you’ve created a macro, you don’t necessarily have to re-record it to change the way it behaves. In many cases, you will find it more expedient to change its behavior by simply editing its contents in the Visual Basic Editor. Note that if the macro you want to edit is stored in your Personal Macro Workbook (that personal.xlsb file in the XLSTART folder — see Book VIII, Chapter 1 for details), you must unhide this workbook before you edit it in the Visual Basic Editor.
To unhide the Personal Macro Workbook, follow these steps:
1. Click the Unhide command button on the Ribbon’s View tab or press Alt+WU.
Excel opens the Unhide dialog box showing the workbook, PERSONALB, in its Unhide Workbook list box.
2. Click PERSONALB in the Unhide Workbook list box and then press Enter.
This action makes the Personal Macro Workbook visible and activates it so that you can now edit its macros in the Visual Basic Editor.
To open a macro for editing in the Visual Basic Editor, follow these steps:
1. Click the View Macros option on the Macros command button on the View tab or press Alt+WMV or Alt+F8.
This action opens the Macro dialog box showing all the names of the macros that you’ve defined in the workbook and in your Personal Macro Workbook.
 




















































































   740   741   742   743   744