What You'll Learn

  • How to enable the Developer tab
  • How to record and play back a basic macro
  • Why Excel disables macros by default in downloaded files
  • Why macro-enabled workbooks use the .xlsm file extension

A macro records a sequence of actions in Excel and lets you play them back automatically — useful for any task you find yourself repeating exactly the same way over and over.

Enabling the Developer Tab

Macros live under the Developer tab, which isn't shown by default. Enable it via File > Options > Customize Ribbon, and check the Developer box in the right-hand list.

Recording Your First Macro

Developer > Record Macro, give it a name (no spaces), and optionally assign a keyboard shortcut. Perform the steps you want recorded — formatting a table, for instance — then Developer > Stop Recording. Your macro is now saved and can be replayed with Developer > Macros > Run, or your assigned shortcut key.

A Word of Caution

Macros can contain code that modifies your workbook or system, so Excel disables macros by default in files downloaded from the internet or received by email, and will warn you before enabling them — never enable macros in a file from a source you don't trust.

Saving a Macro-Enabled Workbook

A workbook containing macros must be saved with the .xlsm extension instead of the usual .xlsx — Excel will prompt you about this automatically the first time you save.

Common Mistakes

  • Enabling macros in an untrusted file without knowing what the macro actually does
  • Saving a workbook with a macro as a regular .xlsx file, which silently strips the macro out

Practice Exercise

Enable the Developer tab. Record a macro that applies bold formatting and a border to a selected range. Stop recording, then run the macro on a different range to confirm it replays correctly.

Ready to Test What You Learned?

Take a short quiz to check your understanding.

Take a Quiz

Key Takeaways

  • A macro records and replays a sequence of actions
  • The Developer tab must be enabled manually before recording a macro
  • Macro-enabled workbooks must be saved as .xlsm, not .xlsx
  • Never enable macros in a file from a source you don't trust