A macro is a saved sequence of instructions that automates a task. Excel’s Macro Recorder records actions as VBA code. It can save repeated formatting work, but it also records unwanted actions. A recorded task needs checking before it is reused.
Microsoft’s Macro Recorder guide covers Windows and Mac desktop Excel. Excel for the web cannot create, run or edit VBA macros; opening a macro-enabled workbook in a browser is not the same as running its macro.
Try a formatting-only example
Create a new practice workbook with this fictional table in A1:C4:
| Item | Quantity | Unit price |
|---|---|---|
| Notebooks | 5 | 4.50 |
| Pens | 12 | 1.25 |
| Folders | 8 | 2.00 |
The goal is only to make the headings bold and display the unit prices with two decimal places. Do not record deleting files, sending messages or changing a live business workbook.
- Enable the Developer tab if needed, using Microsoft’s linked instructions for your platform.
- Choose Record Macro, name it
FormatPracticeTable, and store it in This Workbook. Leave the optional shortcut unassigned. - Select A1:C1 and apply bold formatting.
- Select C2:C4 and apply a number format with two decimal places.
- Choose Stop Recording.
Keep the workbook in a format that preserves macros when you save it, and follow your organisation’s macro-security policy. Do not lower global security settings or enable an unknown downloaded macro to follow this exercise.
Check what the recording actually does
Remove the bold heading format and change C2:C4 back to General. Run FormatPracticeTable from the macro list. The headers should become bold again and the prices display as 4.50, 1.25 and 2.00. Quantities and underlying price values should be unchanged.
Now enter a fourth item on row 5. A recording that formats C2:C4 should not be assumed to include C5. Microsoft’s guide specifically warns about recorded ranges. This small test reveals the difference between replaying fixed actions and designing automation that adapts to new records.
If an unexpected cell changes, stop and review the recording in the VBA editor or re-record the smaller task. Testing on a copy makes it easier to compare before and after. This example is documentation-based; menu wording can differ by Excel version.
When another tool is a better starting point
Use a formula when a result should update from cell inputs. Use a Table when an ordinary expanding list is the main problem. Compare Power Query for repeatable import and cleaning before recording many manual cleanup steps. A macro is useful when the task actually requires replaying or programming actions.
The Excel formulas guide and productivity resources cover those foundations. For the published course covering macros, VBA modules and form controls, compare Excel Expert Macros and Forms. For importing and cleaning data, compare Excel Expert Data Management.
