Excel 2016 Macros

Lesson 3 – Editing Macros

Excel 2016

NOTE You can also run a macro directly from the Visual Basic Editor by pressing the [F5] key.

P ROCEDURES

1. Open a workbook containing macros and enable the macros. 2. Display the Developer tab on the Ribbon .

3. Select in the Code group to open the Visual Basic Editor. 4. Open the module containing the macro you want to run. 5. Click in the macro text you want to run. 6. Click the Run Sub/UserForm button on the Visual Basic Editor Standard toolbar.

S TEP - BY -S TEP Run a macro from the Code window.

Press [Alt+F11] to toggle to the Visual Basic Editor window and double-click Module3 in the Project Explorer task pane.

If necessary, scroll to view the Urban_Update macro in Module3 . Notice that it performs the following actions: opens the TAMPA.XLSX , ATLANTA.XLSX , and CHICAGO.XLSX workbooks; runs the CleanUp macro; consolidates the data from the three workbooks into the CITY59.XLSM workbook; formats the consolidated data range; runs the Company macro; and then closes the TAMPA.XLSX , ATLANTA.XLSX , and CHICAGO.XLSX workbooks.

Steps

Practice Data

1. Click in the macro text you want to run. The insertion point is placed in the desired macro text.

Click after the text Range(“C6:F9”).Select in the Urban_Update macro

2. Click the Run Sub/UserForm

Click

button on the Visual Basic Editor Standard toolbar. The macro commands are executed.

Page 54

OFFICEPRO, Inc.

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