Create a Macro for Text Formatting

Using a laptop
Sasha Radosavljevic on Getty Images

If you frequently need to format text in a very specific way that incorporates several different formatting options, you may want to consider creating a macro.  

What is a Macro

To put it simply, a macro is a shortcut for performing more than one task.  If you press "Ctrl + E" or click on the "center text" button from the ribbon when working with Microsoft Office Word, you will notice that your text is automatically centered.

 While this may not seem like a macro, it is.  The alternate route that you would need to take to center your text within a document would be using the mouse to click your way through the following process:

  1. Right click on text
  2. Select Paragraph from the pop-up menu
  3. Click on the Alignment box in the general section of the Paragraph dialog box
  4. Click on the Center option
  5. Click OK on the bottom of the dialog box to center the text

A Macro will allow you apply your custom formatting to any selected text with the click of a button rather than having to change the font, text size, positioning, spacing, etc... manually.  

Create the Formatting Macro

While creating a macro may seem like a complicated task, it is actually quite simple.  Just follow these four steps.

1. Select a section of text for formatting
2. Turn on the macro recorder
3. Apply the desired formatting to your text
4. Turn off the macro recorder

Use the Macro

To use the macro in the future, simply select the text to which you want to apply the formatting using your macro.  Select the Macro tool from the ribbon and then select your text formatting macro.Text entered after you run the macro will retain the formatting of the rest of the document.

You can also refer to our introduction to macros article to learn how to use them to automate many different processes with Microsoft Office Word 2007, 2010.

Edited by: Martin Hendrikx

Was this page helpful?