Imagine this: Every day, you format tables, copy data, or perform the same calculations in Excel. It eats up hours of your time—but there’s a faster way: macros.
Macros are recorded sequences of actions that Excel can perform automatically. With them, you can:
✅ Automate repetitive tasks
✅ Reduce errors
✅ Save time
In this guide, we’ll walk through how to create and use macros—no programming knowledge required!
🔹 Step 1: Enabling the “Developer” Tab
By default, the “Developer” tab is hidden. To enable it:
- Right-click the ribbon → “Customize the Ribbon”
- In the right panel, check the box next to “Developer”
- Click “OK”
🔹 Step 2: Recording Your First Macro
Example task: Automatically format a table (bold headers, borders, fill color).
- Go to the “Developer” tab → “Record Macro”
- Name your macro (no spaces!), e.g., “FormatTable”
- Click “OK” and perform your actions:
- Select headers → Ctrl+B (bold)
- Add borders (Home → Borders)
- Apply fill color (Home → Fill Color)
- Stop recording (“Developer” → “Stop Recording”)
🔹 Step 3: Running the Macro
To apply the macro to a new table:
- Open your data sheet
- Go to “Developer” → “Macros”
- Select your macro → Click “Run”
🔹 Step 4: Saving Files with Macros
Excel won’t save macros in the default .xlsx
format. Instead:
- File → Save As
- Choose “Excel Macro-Enabled Workbook (*.xlsm)”
🔹 Step 5: Useful Macro Examples
1. Auto-Save Every 10 Minutes
(VBA code to paste via **”Developer” → “Visual Basic”)*
Private Sub Workbook_Open() Application.OnTime Now + TimeValue("00:10:00"), "SaveBook" End Sub Sub SaveBook() ThisWorkbook.Save Application.OnTime Now + TimeValue("00:10:00"), "SaveBook" End Sub
2. One-Click Data Sorting
- Record a macro while sorting data (Data → Sort)
- Assign it to a button (“Developer” → “Insert” → Button)
🔹 Important: Macro Security
Macros can contain harmful code. Stay safe by:
- Only opening files from trusted sources
- Adjusting security settings in “Excel Options” → “Trust Center”
🎯 Conclusion
Now you know how to record and run macros in Excel—a powerful tool to save hours of manual work.
What’s next?
- Try recording your own macro
- Explore VBA for advanced automation
Want more Excel guides? Let us know in the comments! 🚀