Excel 2016 Macros

Excel 2016

Lesson 3 – Editing Macros

Select the File menu and then Close and Return to Microsoft Excel . Click the Macros button in the Code group on the Developer tab and run the Open_Cities macro in the CITY57.XLSM workbook. Then, run the Close_Cities macro to close the NEWYORK.XLSX , ATLANTA.XLSX , and CHICAGO.XLSX workbooks.

E DITING M ACRO C OMMANDS  D ISCUSSION

Depending on the changes you need to make, it may be easier to edit the macro text rather than to delete the entire macro and record it again. You can use standard editing techniques to edit macro text.

NOTE You can rename a macro by changing the macro name in the Sub command. You may want to change any associated comments, descriptions, or shortcut keys. Changing comment text in the Code window does not change the text or shortcut key in the macro itself. To carry out these changes, you must use the Options button in the Macro dialog box to open the Macro Options dialog box. You can rename a module in the Visual Basic Editor by selecting the module in the Project Explorer task pane and typing the desired name into the (Name) box in the Properties window. Be careful when editing command statements; if you do not use the correct syntax and punctuation, the macro may not work correctly or may not run at all.

P ROCEDURES

1. Open a workbook containing macros you want to edit and enable the macros. 2. Select the Developer tab on the Ribbon .

3. Select in the Code group. 4. Select the macro you want to edit from the Macro list. 5. Select . 6. Select the text you want to edit. 7. Edit the selected text.

OFFICEPRO, Inc.

Page 49

Made with FlippingBook - professional solution for displaying marketing and sales documents online