Excel 2016 Macros

Lesson 3 – Editing Macros

Excel 2016

Make sure that your current folder is set for the path containing the student data files.

Steps

Practice Data

1. Select the macro text you want to copy. The macro text is highlighted as you drag.

Drag to select the Workbooks.Open Filename:= "NEWYORK.XLSX" text

2. Release the mouse button.

Release the mouse button

The desired macro text is selected.

3. Select the Copy button on the Visual Basic Editor Standard toolbar.

Click

The text is copied to the Clipboard.

4. Position the insertion point where you want to paste the macro text. The insertion point is placed in the desired location. 5. Select the Paste button on the Visual Basic Editor Standard toolbar. The copied macro text is pasted at the insertion point.

Scroll as necessary and click in the Open_Cities macro in the line above the End Sub command

Click

Press [Home] to place the insertion point to the left of the inserted macro text Workbooks.Open Filename:= "NEWYORK.XLSX" and press [Tab] to indent it. Press [End] and then press [Enter] .

Practice the Concept: Select the text in the Atlanta macro that opens the ATLANTA.XLSX workbook, copy and paste it into the Open_Cities macro, on the line below the step that opens the NEWYORK.XLSX workbook.

Then, double-click Module2 in the Project Explorer task pane to display the CITY58.XLSM - Module2 Code window. Select and copy the step in the Chicago macro that opens the CHICAGO.XLSX workbook. Paste the macro text into the Open_Cities macro in the Module1 Code window, on a line below the step that opens the ATLANTA.XLSX workbook. All three macro commands should appear above the End Sub command.

Page 48

OFFICEPRO, Inc.

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