Microsoft Word has many features that let you save time while working on your projects. One of them is the use of macros. If you’ve never heard of or used macros in Word before, then read on.
A macro is a series of commands that are recorded and launched with a keyboard shortcut. They’re useful for automating steps that you expect to be repeating in a document or a series of documents.
For example, use a macro to automate the following:
- setting up customized formatting (size, margins, etc.) for a document
- creating tables with the same formatting as well as column and row labels
- inserting a group of objects in a document
- finding and replacing specific words or phrases
This article shows you, step-by-step, how to write a macro in Microsoft Word.
Note: In this article, I’m using Microsoft Word for Mac version 16. If you’re using a different version of Word, your interface and workflow may be different.
How to Create a Macro
Are you looking for ways to save time while using MS Word? Learn how to create macros in Word:
1. Record Macros in Word
You create a macro in Microsoft Word by using the macro recorder. This records a series of steps and assigning a keyboard shortcut for it. To record a macro, follow these steps.
Go to View > Macros > Record Macro….
The Record Macro dialog opens.
Give the macro a name. Note that you can't use spaces and special symbols in the macro name.
Under Store macro in:, choose whether you want to save the macro in All Documents or only the document you’re currently working on. By default, macros are stored in All Documents, which means you can run the macro in any document you're working on. If you want the macro to be available only in the current document, then select the current document's file name, which should appear on the list.
Type a description for the macro, so you’ll remember what it does.
Under Assign macro to, click Keyboard.
(Note: In other versions of Microsoft Word, you may be able to assign the macro to a button instead of a keyboard shortcut.)
The Customize Keyboard panel opens. This is where you assign a keyboard shortcut to your macro.
In the Press new keyboard shortcut field, type the keyboard shortcut you wish to assign to your macro.
Word will let you know if the keyboard shortcut you typed is already assigned to a different macro.
Clicking on the Assign button will override this existing keyboard shortcut with the macro you’re about to create. It's highly recommended that you don't use shortcuts that have already been assigned in Word. Instead, keep trying a different shortcut until you find one that hasn’t been assigned yet.
Take note of this keyboard shortcut in case you forget it later. Then click Assign.
At this point, you can choose to change where these macro settings are saved. By default, macros are saved in Normal.dotm. This means the macro will be available in all documents you create in Word.
But if you select your current project file, the macro will only be available in the document you’re working on.
After making your selection, click OK. Carry out the steps you wish to include in the macro. For this example, I'll format a table.
When you’re done performing the steps for your macro, click on the icon on the bottom of the screen to stop the macro recording. (It's tiny, but it's there.)
That’s all there is to it! Now, time to see if you did it correctly.
2. Test the Macro
It seems as if nothing has happened … until you test your new macro.
For this example, I'll test the macro by first creating a plain, unformatted table. Next, select the table.
Then, type the keyboard shortcut for the new macro. Or go to View > Macros > View Macros.
Select the name of the macro you want to test, then click Run. The table has been formatted, which means the macro works.
3. Edit Macros in Word
Occasionally, the macro doesn’t run as you want it to. When this happens, you can edit an existing macro.
Go to View > Macros > View Macros.
This opens the Macros panel. Select the name of the macro you wish to edit, then click Edit.
The Microsoft Visual Basic window opens.
As you can see, you’ll have to know how to use Visual Basic for Applications to edit the macro at this level. But you may be able to figure out simple edits.
For this example, I wish for the macro to not change the font to Times New Roman. And so, I'll delete the lines pertaining to fonts.
Click the Save button, then close the Microsoft Visual Basic window.
Now, when we run the macro again, all the other format settings are applied, but the font doesn’t change to Times New Roman.
4. Delete a Macro
To delete a macro, go to View > Macros > View Macros.
In the Macros panel, select the name of the macro you want to delete. Click the minus sign to delete it.
When prompted, confirm that you want to delete the macro by clicking on the Yes button.
You'll see that the macro has been deleted and is no longer on the list of macros. Click the Close button.
… and Replace.
How to Plan Your Macros for Efficiency and Effectiveness
Recording macros can be nerve wracking because it leaves no room for error. If you make a mistake, you’ll have to either edit the macro (assuming you know Visual Basic) or do it over.
But with the following tips, you’re less likely to make mistakes and more likely to succeed with macros in Word:
- First make sure the macro or shortcut doesn't already exist. Why reinvent the wheel? Check first if a macro or keyboard shortcut already exists for the task you want to complete before you create a macro in Word for it. This article has a list of the most common shortcuts in Microsoft Word.
- Plan each move carefully. Before recording the macro, it pays to plan each of the steps you’ll be making. You may even want to write down the steps, to make sure you remember them and in the correct order. While a macro is recording, you can take as long as you need to carry out the steps.
- Practice/test before recording. Do a couple of dry-runs of the steps to make sure the end-result is exactly what you want.
- Use the keyboard and keyboard shortcuts. As much as possible, use the keyboard and keyboard shortcuts to navigate and perform tasks as you record the macro. This is because some mouse movements may not be recorded as a macro. Again, refer to the list of keyboard shortcuts to see what you can use.
- Keep the steps to a minimum. Keep the macro as simple as possible by making only the steps that are necessary. Planning and practicing the steps will help you do this.
Common Microsoft Word Questions Answered (FAQ)
If you're new to using Microsoft Word, you probably have lots of questions. I've rounded up some of the most common MS Word questions (and answers) below:
1. What Is Microsoft Word?
Microsoft Word is word processing software. It's also part of the Microsoft Office suite. Use it to create most types of documents. Learn more in this tutorial:
- What Is Microsoft Word (Definition)? What Is MS Word Used For? (+Top Features)Alexis (Lexi) Rodrigo10 Aug 2021
2. Can I Change the Font in Word?
Although Word comes with default font, you may want to use a different font for your document. Fortunately, you can change the font for a block of text or an entire paragraph style. You can also add fonts to Microsoft Word.
Here's a tutorial to help you change fonts in Word:
- How to Change the Default Font in Microsoft Word (+ Best 2020 Font Styles)Alexis (Lexi) Rodrigo28 Feb 2020
3. How Do I Add a Page Break in Word?
Page breaks are used to manually end a page. They're especially useful if you're ending a section, but the page is not full. To learn how to use page breaks in Microsoft Word, review this:
- How to Insert, View, or Delete Section (& Page) Breaks in Microsoft Word (+Video)Alexis (Lexi) Rodrigo25 Oct 2021
4. Can I Draw With MS Word?
While you may not ordinarily think of MS Word as a drawing tool, it may surprise you to learn that it does have some drawing tools. Learn about drawing with Microsoft word in the following:
5. What Is the Difference Between Word and Google Docs?
While Word and Google Docs are both word processing tools, there are some important differences. If you're just choosing a word processor, you should understand how these tools are different. Study the following article to learn more:
- Microsoft Word vs. Google Docs Compared (Which Is Better to Use in 2020?)Alexis (Lexi) Rodrigo27 May 2020
Learn More About Microsoft Word
Whether you're just learning Microsoft Word or brushing up on your skills, check out our Microsoft Word learning guide to discover more ways to use Word. Here are a few tutorials to get you started:
- How to Quickly Format Basic Text Styles in Microsoft Word DocumentsAlexis (Lexi) Rodrigo11 Nov 2019
- How to Create, Open, and Save New Microsoft Word Document FilesAlexis (Lexi) Rodrigo16 Oct 2019
- How to Compare and Merge Two Microsoft Word DocumentsAlexis (Lexi) Rodrigo11 May 2020
Increase Productivity in Word With Templates
Another way to optimize your productivity in Microsoft Word is by using templates. They’re helpful tools to use in your MS Word workflow, so you don’t have to start from scratch.
Envato Elements and GraphicRiver are good sources for professionally designed templates and other creative tools. Elements provides thousands of creative Word print templates, fonts, stock photos, and other creative ingredients for your project. You get unlimited downloads for one, low monthly subscription. This is a cost-effective option if you've got many Word projects.
For one-off Word projects, you may want to get your Microsoft Word templates from GraphicRiver. It also offers a wide selection of professionally designed creatives for your Word project, but on a pay-per-use basis.
Master Macros in Word and Maximize Your Workflow
The next time you find yourself performing the same tasks in Microsoft Word over and over, remember that you don’t have to. You can use macros, instead. Save yourself precious time and effort. Instead of doing repetitive tasks yourself, record a macro and launch it with a simple keyboard shortcut.
And use Word templates from Elements or GraphicRiver to further maximize your productivity in Word. Look to Elements for unlimited downloads of professionally designed Word templates and other creative components for a flat monthly fee. Or, go to Graphic River to get templates for Word, if you’d rather pay per use.