What is a Macro?

Derek Schauland

A macro is a series of keyboard strokes recorded by an application. These keystrokes often represent commands within a piece of software which are combined to reduce the work needed to perform the functions. Macros are then stored within the application to allow for repeated use.

Hitting Ctrl + S controls the save action on a computer.
Hitting Ctrl + S controls the save action on a computer.

When recording a macro within an application like Microsoft Word®, the keyboard strokes or commands get bound to a shortcut key or stored within a toolbar making them accessible via the mouse. Then the saved sequence of commands can be executed simply by clicking a tool bar button or pressing the assigned keys.

The 'Ctrl' key is a modifier key that is intended to be pressed down in combination with one or more other keys.
The 'Ctrl' key is a modifier key that is intended to be pressed down in combination with one or more other keys.

Suppose a Microsoft Word® user was looking for a quick way to save a document and then exit Word®. This could be recorded within a macro to combine the save action and the exit action as follows using Microsoft Word® 2007:

    1.Choose the View tab from the office ribbon
    2.Select the Macros object from the Macros group on the right end of the ribbon
    3.Select record macro from the fly out menu

Once the record macro object has been clicked, a dialog box appears which allows the user to provide a name for it and to assign the toolbar button or keyboard shortcut that will trigger it. Usually when assigning a keyboard shortcut for a macro, the Ctrl, Shift, or Alt keys are pressed in combination with the key being assigned. The modifier keys, Ctrl, Shift, and Alt, can also be pressed together in any combination with a key. The idea is to keep the macro keyboard strokes as simple as possible to allow for easily repeated use.

    4.Enter a name for the macro
    5.Assign the keyboard strokes or tool bar selection that will trigger the macro, for this example choose Ctrl + Alt + X
    6.Click OK

Then the actions which will make up the macro need to be performed so they can be saved. In the example provided here, the save menu button near the top of the Microsoft Word® 2007 window, displayed as a small disk, would be clicked followed by the Office® Logo button, also at the top left. When the Word® menu displayed the Exit Word object would be selected to close the application or the close option to close the currently active document.

After the actions have been performed, the user would select the stop recording option from the macros group on the view menu of the Office ribbon. This would prevent further actions from being recorded and save the series for future use.

Once a macro has been created, it can be used to quickly perform the saved sequence of commands assigned to the shortcut key. In our save and exit example, pressing Ctrl + Alt + X will save the current document and exit the Microsoft Word® application.

Another thing to keep in mind when assigning shortcut keys is to be careful not to overwrite selections already in use, like Ctrl + S which controls the Save action by default. When a key combination is tried, the existing action is displayed to let the user know that the keyboard strokes they are trying to use for a macro are already used by the application. It is always best to combine Ctrl with Shift or Alt when assigning keystrokes to a new series to avoid removing existing useful shortcuts.

You might also Like

Discussion Comments


How do I copy macros in Word 2000 to another computer?

Post your comments
Forgot password?