Create a macro

  • Before you record a macro, rehearse what you intend to do.
  • Go through all the steps and commands you want the macro to perform so that you can iron out possible snags.
  • It is best to record the macro in a new document to ensure that you do not pick up existing text or objects on the page as part of the macro recording.
  • If you make a mistake when you record the macro, corrections you make will also be recorded. You can edit the macro later.
  • If you want to use the macro you’re recording in other documents, make sure that the macro doesn’t depend on any of the current document’s contents.


IDevice Icon Video

Watch the following video to see a demonstration of creating a macro: 

Flash video: Create a macro


IDevice Icon Help

When you are recording a macro you cannot use the mouse to select text.

To select text, you have to use the SHIFT key together with the arrow keys or the Home and End keys.


IDevice Question Icon Multi-choice
To start recording a macro, go to the Tools menu and select:
       
Macro - Macros.
Macro - Visual Basic Editor.
Macro - Record New Macro.

Macro names:
       
Must start with a number.
Cannot include spaces.
Cannot include the underscore mark.

If you give a new macro the same name as an existing macro:
       
The new macro will replace the previously recorded macro.
Word will warn you that another macro with the same name already exists.
Word will change the name of the new macro for you.

IDevice Icon Activity 1: Create an Address macro

Open a new document in Word.

Create a macro to do the following:

  • Call the macro 'Address'.
  • In the Description box type “This macro will insert my address at the top of the page.”

  1. Type your departmental address.
  2. Select the address you have entered by using the keyboard (SHIFT + arrow keys).
  3. Format the address in the way of your choice.
  4. Press the END key to move the cursor to the end of the address.
  5. Press the ENTER key to start a new paragraph.
  6. Press CTRL+SHIFT+N to remove the formatting and reapply the default Normal style.


IDevice Icon Activity 2: Create a Name macro

Open a new document in Word.

Create a macro to do the following:

  • Call the macro 'Name'.
  • In the Description box type “This macro will insert and format my name.”

  1. Type your name.
  2. Select the text you have entered by using the keyboard (SHIFT + the Home key).
  3. Format the selected text as bold, 24 points and centre aligned.
  4. Format the text in the colour of your choice.
  5. From the Format menu select Font then from the dialog box select the Text Effects tab.
  6. Select Sparkle Text and then click OK.
  7. Press the END key to move the cursor to the end of the line.
  8. Press the ENTER key to start a new paragraph.
  9. Press CTRL+SHIFT+N to remove the formatting and reapply the default Normal style.

IDevice Icon Activity 3: Create a Table macro

Open a new document in Word.

Create a macro to do the following:

  • Call the macro 'Table'.
  • In the Description box type "This macro will create a table with the days of the week in the top row."
  1. Change the page from Portrait to Landscape.
  2. Create a table with 7 columns and 4 rows.
  3. Type the days of the week in the top row.
  4. Format the background of the cells in the top row with a colour.
  5. Make sure you move the cursor outside the table before you stop recording.

Use the menu on the left to navigate your way to the next page.