Edit a macro

Before you edit a macro, you should be familiar with the Visual Basic Editor. The Visual Basic Editor can be used to write and edit a macro that is attached to a Microsoft Office Excel workbook.

  1. If the Developer tab is not available, do the following to display it:

    1. Click the Microsoft Office Button Office button image, and then click Excel Options.

    2. In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

      Note   The Ribbon is a component of the Microsoft Office Fluent user interface.

  2. To set the security level temporarily to enable all macros, do the following:

    1. On the Developer tab, in the Code group, click Macro Security.
      The Code group on the Developer tab

    2. Under Macro Settings, click Enable all macros (not recommended, potentially dangerous code can run), and then click OK.

      Note   To help prevent potentially dangerous code from running, we recommend that you return to any of the settings that disable all macros after you finish working with macros.

  3. On the Developer tab, in the Code group, click Macros.

  4. In the Macro name box, click the macro that you want to edit.

  5. Click Edit.

Tip   For Help with the Visual Basic Editor, on the Help menu, click Microsoft Visual Basic Help, or press F1.

Applies To: Excel 2007



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language