How to use this in Excel (click to show or hide)
- Open your workbook in Excel and press Alt + F11. The VBA editor window opens.
- In the top menu click Insert → Module. A big blank white box appears.
- Pick a macro below, click Copy code, then click in the white box and press Ctrl + V to paste.
- Close the VBA editor (the X in the top-right corner) to go back to your sheet.
- Press Alt + F8, click the macro's name, then click Run.
Keeping the macro: to keep it in the file, save as Excel Macro-Enabled Workbook (*.xlsm) using File → Save As. A normal .xlsx file throws macros away.
Tip: you can paste several macros into the same module, one under the other.
Optional: show the Developer tab
File → Options → Customize Ribbon → tick Developer on the right → OK. The Developer tab has Visual Basic (same as Alt+F11) and Macros (same as Alt+F8) buttons.
Written for Excel on Windows (Excel 2010 or newer, including Microsoft 365). Most macros also work on a Mac, but the ones that count unique values or make summaries need Windows.
Before you run it:
⚠ Save a copy first — Undo won't work after a macro. This one changes your data.
Macro name to pick in Alt+F8:
👆 Pick a job in Step 1 and a task in Step 2 to see the macro.