Excel 2016 Macros

Lesson 3 – Editing Macros

Excel 2016

If a group of commands can be recorded, it might be easier to record the macro steps in a separate macro and then copy and paste them into the larger macro, than it would be to write them directly into the Code window.

NOTE The Visual Basic Editor provides a variety of help features. As you type a command, pop-up help may appear. The Auto Quick Info box and the Auto List Member list both provide help with either parameters or available methods and properties. The syntax of your command is automatically verified when you move to another line.

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 to which you want to add a command. 5. Position the insertion point where you want to add the command. 6. Press [Enter] . 7. Type the desired command. 8. To enter a property or method, type a period ( . ). 9. Type the desired property or method, or select it from the Auto List Member list. 10. Press [Enter] .

S TEP - BY -S TEP From the Student Data directory, open CITY59.XLSM . Type a macro command.

If necessary, enable the macros. Open the Visual Basic Editor using the Visual Basic button in the Code group on the Developer tab. Then, open the CITY59.XLSM - Module1 Code window using the Project Explorer task pane to display the Open_Cities macro.

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

Page 52

OFFICEPRO, Inc.

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