How to Create a Macro for Text Formatting

Man typing on laptop in coffee shop

Westend61 / 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 to apply your custom formatting to any selected text with the click of a button rather than having to change the font, text size, positioning, or spacing 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.

Using 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.

Edited by Martin Hendrikx