The following instructions for recording a macro in Microsoft Excel are adapted from the Microsoft Excel 97 Help File:
  1. On the Tools menu, point to Macro, and then click Record.
  2. In Macro name, enter a name for the macro.

    Note: The first character of the macro name must be a letter. The other characters can be letters, numbers, or an underscore. Spaces are not allowed in a macro name; instead, use an underscore to separate words.

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

    Note: The shortcut key letter 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.

  4. In Store macro in, click the location where you want to store the macro.

    Note: 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.

  5. (Optional) In Description, type a description of the macro.
  6. Click OK.
  7. When 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. To select cells regardless of the position of the active cell when you run the macro, on the Stop Recording toolbar, click Relative Reference.

    Microsoft Excel will continue to record macros with relative references until you quit Microsoft Excel or click Relative Reference again.

    Note: 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 relative and absolute references when you record the macro. When you want to record relative references, select Relative Reference. When you want to record absolute references, de-select Relative Reference.

  8. Carry out the actions you want to record.
  9. On the Stop Recording toolbar, click Stop Recording.

    The macro is stored in the location you chose.

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016