Using the Macro Recorder to Create Simple Macros in Excel 2003

This tutorial describes how to use the Macro Recorder to create a simple macro in Excel. The tutorial does not cover creating or editing a macro using the VBA editor.

Contents
  1. Starting the Excel Macro Recorder
  2. Macro shooting options
  3. Excel macro recorder
  4. Run a macro in Excel
  5. Macro editing

Starting the Excel Macro Recorder

The easiest way to create a macro in Excel is to use the Macro Recorder.

Click on Tools > Macros > Record a new macro from the menu to open the Record Macro dialog box.

Macro shooting options

This dialog box has four options:

  1. Name – give your macro a descriptive name.

  2. Shortcut Key – (Optional) Enter a letter in an empty space. Allows you to run the macro by holding down the CTRL key and pressing the selected letter on the keyboard.

  3. Save macro in –

    1. Options:

    2. current workbook

      1. The macro is only available in this file.

    3. new workbook

      1. This option opens a new Excel file. The macro is only available in this new file.

    4. personal macro book.

      1. This option creates a hidden file, Personal.xls, that stores your macros and makes them available to you in all Excel files.

  4. Description – (Optional) Enter a description for the macro.

Excel macro recorder

When you have finished setting the parameters in the dialog box macro recorder in the previous step of this tutorial, click the OK button to start the macro recorder.

Toolbar Stop recording should also appear on the screen.

Macro Recorder records all keystrokes and mouse clicks. Create your macro:

  • by manually going through all the necessary steps.

  • When you’re done, click the stop button (small blue square) on the toolbar Stop recording

  • If the toolbar Stop recording not available, click on Tools > Macros > Stop Recording in the menu to stop recording.

Run a macro in Excel

To run the macro you wrote:

  • If you selected a hotkey when creating a macro, press and hold the key CTRL on the keyboard and press the hotkey.

Different,

  1. Select Tools > Macros > Macro from the menu to open the dialog box macro

  2. Select a macro from the list of available ones.

  3. Press the button Run

Macro editing

An Excel macro is written in the Visual Basic for Applications (VBA) programming language.

When you click the “Edit” or “Join” buttons in the dialog box macro the VBA editor will start (see image above).

Macro errors

If you don’t know VBA, it’s best to overwrite a macro that doesn’t work correctly.

Leave a Reply

Your email address will not be published.