advanced Estimated learning time: 5 h

6.3 VBA when you need it

You can read, fix and write a simple macro in an inherited workbook.

Before:04. Excel — Cleaning & Power Query

VBA is the older automation language living in the desktop apps, and inherited workbooks are full of it, so being able to read, fix and write a simple macro remains a real skill. This topic covers the Visual Basic editor, variables, ranges, loops and events, at the depth needed for maintenance rather than mastery. The common confusion is security: macro-enabled files are blocked by many organisations for good reasons, and understanding trusted locations and the xlsm format is part of using VBA responsibly rather than fighting the blocks.

Work through these

  • The Visual Basic editor, modules and the macro recorder

    The editor, the modules that hold code, and the recorder that writes a first draft for you. Most people meet this environment because they inherited a file, not because they chose it.

  • Variables, ranges, loops and conditions

    Variables, ranges, repetition and decisions are the same four ideas as in any language, in this language's vocabulary. Enough to read and repair an inherited macro.

  • Events, buttons and user forms, briefly

    Code that runs when something happens, buttons that run it deliberately, and simple dialogues, covered briefly. Enough to recognise them in a file you did not write.

  • Macro security, .xlsm files, and why organisations block them

    Macro-enabled files are treated with suspicion by default and are blocked outright in many organisations. Knowing why explains a great deal of workplace friction around these files.

Practice file

Opens in Excel. Every name, number and address in these files is made up. No account needed to download.

Sign in to keep your progress.

Free resources

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.