Microsoft Word 2013 Training: How to Record Macros
Need more Word training? Click here for the complete tutorial.
Recording Macros
Macros are small programs that record your keystrokes as you perform a task, and then save the actions you performed as a Visual Basic Module- a type of program file. When you run the macro later, it will repeat your keystrokes, thus repeating your actions. This is why they are great for automating repetitive tasks. For example, if you wanted to create a macro that would place your company’s name and address information in the upper left corner of a document, you could record a macro as you enter the information once, and then run the recorded macro to do it again in the future. It would repeat the exact same keystrokes that you entered, effectively replicating the process instantaneously.
You can see advanced options for creating macros on the “Developer” tab in the Ribbon, if it is enabled. You can also use the “Macros” button group on the “View” tab in the Ribbon to record and playback basic macros that you record. In this lesson, we will examine how to record a basic macro using the commands found within this group in the Ribbon.
To begin to record a macro, you can click the “Macros” button in the “Macros” button group on the “View” tab in the Ribbon. From the drop-down menu that appears, select the “Record Macro…” command. This will open the “Record Macro” dialog box. In the “Record Macro” dialog box, enter a name for your new macro in the “Macro name” text box. Note that macro names cannot contain spaces!
Next, select the template or document to which you would like to attach the macro from the “Store macro in:” drop-down. It will default to the “Normal” macro-compatible document template (.dotm), which is the document template that new macro-enabled documents are based upon. A macro can only work if it is attached to the actual document in which it will be used, or if it attached to the document template from which the current document was produced. So, if the macro is one that you want for all documents that use macros, then selecting the “All documents (Normal.dotm)” template choice is a good idea! Otherwise, just select the template or file to which you will attach the macro. Then click the “OK” button to start recording.
While recording your macro, you cannot use your mouse very much and you should minimize your mouse movements during the recording of the macro. Instead, try to use the keyboard as much as possible. Once you have finished recording your macro, click the “Macros” button in the “Macros” button group on the “View” tab in the Ribbon. Select the “Stop Recording” command in order to stop recording the macro.
Also, if necessary, you can choose the “Pause Recording” command from the button’s drop-down menu to pause the macro while recording. You can click the “Macro” button, and then select the Resume Recorder” command in order to resume recording the macro when you are ready to continue.
Running and Deleting Recorded Macros
To run a recorded macro, you can click the “Macros” button in the “Macros” button group on the “View” tab in the Ribbon. If there are macros that are available to run, then you can choose the “View Macros” command from the button’s drop-down. If you do not see this command, then you may not have any recorded macros available for use. Otherwise, once you select this command, you will see the “Macros” dialog box appear. You use this dialog box to manage your macros.
A listing of the macros that are available will appear in the large white list box shown within the “Macros” dialog box. To run a macro shown in this list, click on its name it select it. Then click the “Run” button to run the selected macro.
You can also delete macros that you no longer want or need using this dialog box. To delete a macro, select the name of the macro from the macro list and then click the “Delete” button. Click the “Yes” button in the confirmation message box that appears in order to delete the selected macro. Once you have finished using the “Macros” dialog box, click the “Close” button to close it.
Assigning Macros
Word 2013:2010 allows you to assign a macro to a button that appears in the Ribbon, the Quick Access toolbar, or to an unused keyboard shortcut of your choosing. This can make running macros much easier than the process involved with running them through the “Macros” dialog box. Once you have assigned a macro to a button or a keyboard shortcut, you can simply click the button or press the keyboard shortcut in order to run the associated macro.
You assign macros to buttons or keyboard shortcuts in the “Word Options” dialog box. You can access this dialog box by clicking the “File” tab in the Ribbon and then clicking the “Options” button in the lower left corner of the command panel. This will open the “Word Options” dialog box.
Next you must decide if you want to assign the macro to a button on a tab within the Ribbon, to a button in the Quick Access toolbar, or to a keyboard shortcut.
If you want to assign the macro to a button on a tab within the Ribbon, then first click the “Customize Ribbon” category at the left side of the “Word Options” dialog box. Next, use the “Choose commands from:” drop-down to select the “Macros” category. You should see the macros that you created appear within this column. You can then select the “Main Tabs” command from the “Customize the Ribbon:” drop-down. You will then see the tabs and groups appear in the column as a collapsed outline. You can click the plus signs to expand a tab and see the groups within it.
When you add macro buttons to a tab, they must appear within their own custom groups that you create on the tab. To do this, start by selecting the name of the tab within which you want to create your custom macro button group. Then click the “New Group” button at the bottom of the column to add a new group to the selected tab. Also note that you can create your own custom tab itself by clicking the “New Tab” button, instead, if you prefer to add your macros to a custom tab versus a custom group. Once you have created a custom group, make sure it is selected in this column. Then select the name of the macro to add to this custom group by selecting it from the “Choose commands from column:.” You can then click the “Add >>” button that appears between the columns to add the selected macro to the selected custom group in the Ribbon. Note that you can then select the custom group, custom tab, or macro button that you have created and click the “Rename…” button at the bottom of the column in order to rename the custom group or custom tab using the “Rename” dialog box. In the “Rename” dialog box, you can select a button symbol from the “Symbol:” section, if desired, and then type a name for the button, group, or tab into the “Display name:” text box. Then click the “OK” button to apply your changes.
Also note the “Reset” button at the bottom of this column next to the “Customizations:” label. You can click this button to select either “Reset only selected Ribbon tab,” or “Reset all customizations” from the drop-down menu that appears. This will reset the currently selected Ribbon tab, or reset all customizations based on which command you choose. You can use this to reset unwanted customizations to the Ribbon, if they occur.
If you want to assign a macro to the Quick Access toolbar instead of to the Ribbon, start by selecting the “Quick Access Toolbar” category from the left side of the “Word Options” dialog box. Then select “Macros” from the “Choose commands from:” drop-down. The name of your macro should appear in the list below the drop-down menu. Select the name of the macro that you want to add to the Quick Access toolbar from this list. Then click the “Add >>” button in the middle of the options window to move the command from the left list to the list at the right side of the window. The list at the right side of the window is a listing of the buttons that will be available on the Quick Access toolbar. Note that you can click on the name of the macro shown in the list at the right side, and then click the small upwards and downwards pointing arrows that are next to it in order to move the command up or down through the listing of button commands. Also, if you want to give the button a different picture, you can select the name of the macro in the list at right and then click the “Modify…” button at the bottom of the list. In the “Modify Button” dialog box that appears, you can click on the button picture that you want to use for the macro from the “Symbol:” list, enter a name for the button into the “Display name:” text box, and then click the “OK” button.
If you want to assign a macro to a keyboard shortcut instead of a button, start by clicking the “Customize Ribbon” category at the left side of the “Word Options” dialog box. Then click the “Customize…” button in the lower left corner of the options side of the dialog box. That will open the “Customize Keyboard” dialog box. Select “Macros” from the “Categories” list at the left side of this dialog box. That will then display all of the available macros in the “Macros:” list at the right side of the dialog box. Select the macro that you would like to assign to a keyboard shortcut from the “Macros:” list. Next, click into the “Press new shortcut key” text box and press a new keyboard shortcut combination, such as “Alt”+“Shift”+“B”, for example. If the selected keyboard shortcut is assigned it will display the function to which the keyboard shortcut has been assigned below the “Current keys:” list. If it is unassigned, it will display that fact in the same location. Make sure that the keyboard shortcut that you use is unassigned. If you assign a macro to a standard, or assigned, keyboard shortcut you will overwrite the standard shortcut! Once you can see that your keyboard shortcut is unassigned, click the “Assign” button and then click the “Close” button.
Once you have finished assigning your macros using the “Word Options” dialog box, click the “OK” button in the lower right corner of the dialog box to finish your customization and close the dialog box.