The Recording and Managing Macros module provides you with the instructions and devices to develop your hands on skills in the following topics.
- Recording a Macro
- Organizing Macros
- Editing a Macro
Lab time: It will take approximately 90 minutes to complete this lab.
Exercise 1 - Recording a Macro
As you use Word more often and for more complicated tasks, you might find yourself repeating the same steps over and over. You can save time by creating a macro that automatically performs those steps at the click of a button or press of a keystroke combination.
You will learn:
- About macros and macro security
- How to record macros
- How to run macros
- How to edit macros
You might have heard of macros in the context of power users doing complex and complicated tasks, or as part of a puzzling troubleshooting session. They can sound pretty intimidating. To some extent, this is true: macros are powerful tools used by experienced users, and they do require additional awareness of Word security settings. But it's easy to learn the basics and use macros to automate even your common tasks.
At its heart, a macro is a series of tasks you could do manually but is performed automatically by Word. You can record a macro one step at a time in Word, or compose it in the Visual Basic for Applications (VBA) editor included with Office. You can store it in a document or in a global template, and run it using a button or keystroke combination. You can even configure a macro to run whenever you open a document.
Commands related to macros are located on the Developer tab of the ribbon, in the Code group. The Developer tab isn't displayed by default, so you need to customize the ribbon to display it before you can record or manage macros. Otherwise, you can run only existing macros linked to buttons or keystrokes.
Exercise 2 - Organizing Macros
To manage your macros, in the code group, click Macros. You can perform such tasks for organizing macros like:
- To view or edit a macro's description, select it.
- To filter which macros are displayed, select an open document or template from the "Macros in" list.
- To run a macro, select it, and click Run.
- To edit a macro, click Edit.
- To test a macro a step at a time, click Step Into, then press F8 to continue step by step through it.
- To delete a macro, select it, and click Delete.
- To create a new macro in the VBA editor, type a name, and click Create.
- To copy macros between templates and documents, click Organizer.
Exam Objective: MOS Word Core 1.4.9, 1.4.10
Exercise 3 - Editing a Macro
Excel macros are actually programs written in Visual Basic for Application (VBA). VBA code lives in modules, and a particular macro is stored in a procedure within a module.
As you learned earlier, you can create macros by recording them in Word or by coding them in VBA. Either way, Word stores the macro as a VBA program. So, when you edit or step into a macro, Word opens the Visual Basic Editor in a separate window, displaying the macro.
Programming in Visual Basic is beyond the scope of this course, but if you find yourself using macros regularly, you might want to learn the basics. Even a little coding knowledge can make it easy to make simple tweaks without having to record the macro all over again.
See the full benefits of our immersive learning experience with interactive courses and guided career paths.