Think of a macro as a tape recorder for
keystrokes.
- You can use Tools | Macro
| Record to turn the recorder on and track whatever it is you do
within Excel onscreen. Remember to turn the recorder off when you are done...
- Use Tools | Macro
| Macros | Run to replay what you recorded.
- You can use the Relative Reference button on the Macro
toolbar to play back your macro relative to the current cursor position. Otherwise,
the macro will play in the same cells which you used when you recorded it.
When you record a macro, you will see the Stop
Recording toolbar:

If you want more detail, here is the description from the
Excel Help file.
Record a macro
- On the Tools menu, point to Macro, and then click Record.
- In the Macro name box, enter a name for the macro.
The first character of the macro name must be a letter. Other characters can be
letters, numbers, or underscore characters. Spaces are not allowed in a macro name; an
underscore character works well as a word separator.
- To run the macro by pressing a keyboard shortcut key, enter a
letter in the Shortcut key box. You can use CTRL+ letter (for lowercase letters) or
CTRL+SHIFT+ letter (for uppercase letters), where letter is any letter key on the
keyboard. The shortcut key letter you use cannot be a number or special character. The
shortcut key will override any default Microsoft Excel shortcut keys while the workbook
that contains the macro is open.
- In the Store macro in box, click the location where you want
to store the macro.
If you want a macro to be available whenever you use Microsoft Excel, store the
macro in the Personal Macro Workbook in the XLStart folder.
To include a description of the macro, type the description in the Description box.
- Click OK.
If you select cells while running a macro, the macro will select the same cells
regardless of which cell is first selected because it records absolute cell references. If
you want a macro to select cells regardless of the position of the active cell when you
run the macro, set the macro recorder to record relative cell references. On the Stop
Recording toolbar, click Relative Reference . Microsoft Excel will continue to record macros with relative
references until you quit Microsoft Excel or until you click Relative Reference
again.
- Carry out the actions you want to record.
- On the Stop Recording toolbar, click Stop Recording
.
Tip If you want a macro to select a specific cell, perform an action, and then select
another cell relative to the active cell, you can mix the use of relative and absolute
references when you record the macro. To record a macro by using relative references, make
sure that Relative Reference is pressed in. To record with absolute
references, make sure Relative Reference is not pressed in.
|