Create Macros In Word

A macro in Word 2010 is simply a series of commands that is recorded so that it can be executed automatically. Sequences of steps that you know will be repeated more than once are ideal for substituting with a macro. There are a number of reasons why you might want to create a macro:

  • to speed up your workflow
  • to reduce the chance of making mistakes when performing the steps
  • to simplify your tasks

There are two ways that you can create a Word macro:

  1. Use the macro recorder in Word 2010
  2. Use VBA (Visual Basic for Applications) to write a macro from scratch

VBA involves a certain amount of programming and is trickier for non technical users to tackle, so we’re going to look at the easier option for creating macros – using the macro recorder.

Using The Macro Recorder To Create Word Macros

You can use the Word 2010 macro recorder to record a sequence of actions you perform. The option is available from the View tab (over on the right) and also on the Developer tab, however the Developer tab is not displayed by default. If you want to use the Developer tab, but can’t see it, click the Office button > Word Options > Popular, and check the box to select “Show Developer tab in the Ribbon“. As soon as you switch on this tab, you can see it in the ribbon. You don’t need to close Word 2010 and open it again to see it.

I would recommend using the Developer tab instead of the View tab as it contains more Macro related commands.

To start recording your Word macro, click Developer > Code > Record Macro or View > Macros (the down arrow) > Record Macro.

Record A Macro In Word

Click to enlarge

In the Macro Name box, give your macro a meaningful name. It’s better that you choose something that relates to what the macro does as this will make it easier to identify if you decide to create other macros. It’s important to note that Word 2010 ships with some built in macros and you should avoid using their names. If you do use a name that’s already taken, the new macro will replace the old one and you will make Bill Gates cry. To view a list of built in macros, click Developer > Code > Macros, and ensure that “Macros In” is set to Word Commands.

Assuming that you have named your macro, you now need to specify where to store the macro: in the template (All Documents (Normal.dotm)) or just the Word 2010 document that you’re editing. To make your macro available to all documents, save the macro in Normal.dotm. Describe the macro using the Description box.

You have three choices relating how to run the macro after you’ve recorded it:

  1. by selecting it from the list of macros
  2. by clicking a button in the Quick Access Toolbar
  3. by using a keyboard shortcut

1. Select From A List Of Macros

To run the macro from a list of other macros after you’ve recorded it, don’t click the Button or Keyboard buttons. Just click OK to start recording. Perform the actions you want to record for your macro. You can tell that Word is recording because the cursor changes to a cassette shape. Once you’ve completed all the steps in your macro, click Stop Recording.

To run your macro, click Macros, and find your macro in the list. Select it and click Run. All the steps that comprise your macro will run.

From the Macros window, you can also Edit and Delete macros.

2. Assign A Word 2010 Macro To A Button

To assign the macro to a button on the Quick Access Toolbar, click Button in the Record Macro window. The Word Options window will open for you to add a button for this macro to the Quick Access Toolbar.

Word Options - Macro

Click to enlarge

Select the Macro from the list on the left, click Add, ensure that the macro is then selected in the list on the right and then click Modify. When the Modify Button window opens, select a button that will represent the macro in the toolbar and click OK. When you click OK on the Word Options window, this button will appear in the Quick Access Toolbar. When you click the button, the macro will run.

It’s a pity there’s no way to import your own button and use that to represent your macro. Maybe in Word 2013….?

3. Create A Keyboard Shortcut For Your Macro

You can tell Word that you want to use a keyboard shortcut for your macro in the Record Macro window, however creating a keyboard shortcut for your macro is not intuitive. When you click the keyboard button, you get the following screen, and many people struggle with the Press new shortcut key box:

Press New Shortcut Key

What on earth are we supposed to type in there? If you look at examples of macro keyboard shortcuts on the internet, you will find things like “Ctrl+Shift+M”, but if you type that out, it won’t appear!

In actual fact, you are just supposed to perform the shortcut and Word will register it. So instead of typing the letters: “Ctrl+Shift+M”, just do a Ctrl+Shift+M! You’ll see it appear in the box. Click Assign and then click Close. You can start recording the macro. Click Stop recording when finished, and your new keyboard shortcut will be ready to fire off your macro.

Sponsors