Excel 2016 Macros
Lesson 2 - Recording Macros
Excel 2016
Close the CHICAGO.XLSX workbook. Click the Visual Basic button in the Code group to open the Visual Basic editor. Double-click Module2 in the Project - VBAProject task pane. View the macro in the CITY57.XLSM - Module2 (Code) pane. Notice that the macro has recorded the filename path to the CHICAGO.XLSX workbook. (You may need to resize the pane to see the entire filename path). Select File on the menu bar and then click Close and Return to Microsoft Excel .
Use the [Ctrl+e] shortcut key to run the Chicago macro. Then, close the CHICAGO.XLSX workbook.
A SSIGNING A S HORTCUT K EY D ISCUSSION
You can assign a shortcut key to a macro when you create the macro or after the macro has been created. After a shortcut key has been assigned to a macro, the macro runs whenever the shortcut key is pressed. All macro shortcut keys must begin with the [Ctrl] key followed by any character.
If you assign a shortcut key while the macro is being created, it appears as a comment in the module containing the Visual Basic language statements used to define and create the macro. When a shortcut key is assigned to an existing macro, however, this comment is not automatically created. You can edit the macro text, however, to manually add the comment.
Assigning a shortcut key to a macro
Page 32
OFFICEPRO, Inc.
Made with FlippingBook - professional solution for displaying marketing and sales documents online