Excel 2016 Macros

Lesson 3 – Editing Macros

Excel 2016

S TEP - BY -S TEP

Enter macro comments.

If necessary, enable the macros. Open the Visual Basic Editor using the Visual Basic button in the Code group on the Developer tab and then display the CITY57.XLSM - Module1 (Code) window using the Project Explorer task pane.

Steps

Practice Data

1. Position the insertion point where you want to add the comment. The insertion point is placed in the desired location in the Code window.

Click in the blank line below Sub Open_Cities() , if necessary

2. Type an apostrophe ( ' ).

Type '

The apostrophe ( ' ) appears in the line .

3. Press [Spacebar] .

Press [Spacebar]

A space appears after the apostrophe ( ' ).

4. Type the desired comment text. The comment text appears in the Code window.

Type This macro opens three city files

5. Press [Enter] .

Press [Enter]

The insertion point moves to the next line and the comment text turns green.

Practice the Concept: Double-click Module2 in the Project Explorer task pane to display the CITY57.XLSM - Module2 (Code) window. In the Company macro, click in the blank line above the Selection.Font.Bold = True command. Type an apostrophe ( ' ), then press [Spacebar] . Type the following comment: Formats the current cell . Press [Enter] .

Scroll down, if necessary and click at the end of the End With command in the Company macro; press [Enter] to insert a new line. Then, type the following comment: ' Inserts the company name . Click in the next line to see the comment color change to green.

Page 46

OFFICEPRO, Inc.

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