There’s a moment near the end of the path when you notice you perform a little ritual — the same eight clicks, every time, on every file. Format the header, set the print area, hide the workings, save as PDF. None of it is thinking; all of it is time. Excel has had an answer since 1993: record it once, replay it forever.

That’s a macro — your actions written down as VBA code — and the recorder means your first one requires no programming at all.

Recording one, properly

First, the one-time setup: macros need the Developer tab (File → Options → Customize Ribbon → tick Developer) and a workbook saved as .xlsm — the macro-enabled format. (That security prompt when opening macro files exists because macros can do anything; respect it in both directions — enable your own, question strangers’.)

Then: Developer → Record Macro, name it (Tidy_For_Print, not Macro1the naming rule follows you everywhere), optionally a shortcut key, and Record. Perform your ritual — calmly, correctly, once. Stop Recording. Done: Alt+F8 (or your shortcut) now replays the whole ritual in half a second.

One recording habit separates macros that last from macros that break next Tuesday: relative vs absolute. The recorder normally writes exact addresses — “select C7” — so the macro only works on sheets shaped exactly like today’s. The Use Relative References toggle records movements instead (“two cells right”). Rule of thumb: formatting a fixed report layout, absolute is fine; doing something “wherever I’m standing”, toggle relative first. When a macro misbehaves, this toggle is the first suspect — the $-sign lesson, reincarnated.

recorded once… 1 format header 2 hide workings 3 set print area 4 export PDF …replayed forever ▶ Tidy_For_Print all four steps, half a second, zero fumbles the ritual still happens — you just stopped being the one performing it
Eight clicks become one button. The recorder writes the code; you supply the ritual — once, carefully, and never again.

Read what it wrote

Press Alt+F11 and look at your recording in the VBA editor — not to become a programmer, but because two minutes of reading demystifies the whole thing: your clicks, as sentences (Range("A1").Font.Bold = True). Two small edits are safe and educational — deleting the noise lines the recorder logs (.Select chains, scrolling), and changing a literal value. That’s the same skill as reading a recorded query’s steps, and it’s how recording becomes, eventually, writing. Attach the macro to a button (Insert → Shapes, right-click → Assign Macro) and your ritual now ships with a UI.

When not to record one

The honest half of the lesson, because macro enthusiasm has wrecked more workbooks than it’s saved. The modern rule:

The job The right tool
Import, clean, combine, refresh data Power Query — repeatable and inspectable, no code
Calculations, even gnarly ones Formulas, LET, LAMBDA — live, auditable
Moving files, sending alerts Power Automate
Needs to run in the browser Office Scripts — VBA doesn’t run on the web, full stop
Fiddly interface rituals — formatting, printing, layout Macros. This is the niche.

VBA’s honest niche in a modern workbook is the last row: driving Excel’s interface — the clicks themselves. It’s also the legacy layer you’ll inherit (decades of workbooks run on it, which is why reading recorder output matters even if you never write a line). But a macro is a black box to everyone who can’t read it — invisible in the sheet, unauditable by arrow, mute on the web. Every job a visible tool can do, the visible tool should do.

Record the ritual, read the recording, assign the button — and keep the machinery where people can see it for everything else. Automation was never the goal; attention back for thinking was. The button is just the receipt.