Skip to content
Getting Digital

Macro

Also: VBA macro, recorded macro, macro recorder, Visual Basic for Applications, Apps Script macro

A macro is a stored sequence of commands inside a document or workbook that replays a routine task on request, usually captured by recording the user's clicks and keystrokes and saved as code that can later be edited.

Our take. The recorder is a way to learn the code, not a way to avoid it. A recorded macro replays exactly what was done, including every accidental click, and breaks the first time the data has one row more or a sheet a different name. Macros also carry the reputation they earned: they run with the user's rights, which is why files from the internet arrive with them switched off.

  • Record: in Excel, the Developer tab's Record Macro button captures the actions that follow; in Google Sheets, Extensions, Macros, Record macro does the same.
  • Store: Excel keeps the macro in the current workbook or in a Personal Macro Workbook available to every file on that machine; a Sheets macro lives with its spreadsheet.
  • Edit: Excel writes the recording as Visual Basic for Applications, opened in the Visual Basic Editor; Sheets writes it as Apps Script.
  • Run: from a menu, a keyboard shortcut or a button on the sheet.

The recorder's one important question comes before recording starts. Google Sheets makes the recorder pick between absolute and relative references first, and that pick decides whether the replay touches the exact cells that were recorded or cells positioned the same way around whatever is selected. That is the same distinction a formula's cell reference makes, applied to actions instead of arithmetic, and getting it wrong is the classic reason a macro that worked yesterday formats the wrong column today. Microsoft's own recorder guidance warns of the sibling problem: a recording tied to a range ignores rows added below it later.

Security and the move to the cloud

Because a VBA macro can do anything the user can, it became a favourite way to deliver malware in email attachments. Microsoft changed Office so that macros in files carrying the internet's mark are blocked by default, and the unblock routes, such as a trusted location, are deliberately a few steps away. Inside an organisation, a macro-enabled workbook is still the quickest automation for one person's desktop task. Anything that crosses applications, runs on a schedule or needs to keep running when a laptop is shut belongs in a cloud flow built from connectors instead. The advanced Excel topic places macros and VBA beside Power Query; the workplace automation topic picks up the work that outgrows one workbook.

Related concepts

Where this concept sits in the field

Certifications that test this

Vendor exams whose syllabus covers this concept — facts, cost and a preparation path on each page.

More courses from these shelves

A rotating selection from the course directory, drawn from the subcategories where this concept is taught rather than picked for it. Details, price and the provider link are on the course page.

Financial Modeling for Beginners in Excel in 120 Minutes!

You're Just Seconds Away From Leveraging Excel & Financial Modeling That Will Make It Possible For YOU To:Increase your…

Udemy

Stock Transfers in S4 HANA2025 and above

Intra stock transfer order part1 Intra stock transfer order part2Intra stock transfer order part3ConclusionInter stock…

Udemy

A project management course: Becoming a PROject Manager

A Project Management Course: Becoming a PROject ManagerAre you ready to elevate your career and become a proficient, so…

Udemy

PowerPoint for Consulting and Business presentations

This course is a consolidation of the knowledge that I have accumulated from my multiple years of working in the top co…

Udemy

Oracle Financial Concepts

This course teaches students about the basic Oracle Financial Concepts, including the way to to setup an organizational…

Udemy

Camtasia Studio Video Editing -Beginner to Intermediate 2025

Updated in Jan. 2025Start editing your videos professionally with Camtasia Studio from Techsmith!If you are looking for…

Udemy

Sources

The primary text this definition rests on. Read it before you trust ours.

Last reviewed 26 September 2026 · Getting Digital