Читать книгу Excel Macros For Dummies онлайн
22 страница из 60
Description: This field is optional, but it can come in handy if you have numerous macros in a workbook or if you need to give a user a more detailed description about what the macro does.
With the Record Macro dialog box open, follow these steps to create a simple macro that enters your name into a worksheet cell:
1 Enter a new single-word name for the macro to replace the default Macro1 name.A good name for this example is MyName.
2 Assign this macro to the shortcut key Ctrl+Shift+N.You do this by entering uppercase N in the edit box labeled Shortcut Key.
3 Click OK.This closes the Record Macro dialog box and begins recording your actions.
4 Select cell B3 on your worksheet, type your name into the selected cell, and then press Enter.
5 Choose Developer ⇒ Code ⇒ Stop Recording (or click the Stop Recording button in the status bar).
Examining the macro
The macro was recorded in a new module named Module1. To view the code in this module, you must activate the Visual Basic Editor. (See ssss1 to find out more about the Visual Basic Editor.) You can activate the VB Editor in one of three ways: