5.5Automation: VBA macros
The essentials in 30 seconds
- Project is automated with VBA (Visual Basic for Applications), the same macro language as Excel or Word: a reusable skill.
- The macro recorder is the no-code entry point: it captures a sequence of actions (formatting, filter, view) and replays it at will.
- The VBA editor (Alt+F11) then lets you read, write and modify code to manipulate the object model: bulk processing and custom reporting.
Running mini-case — Meriem automates her repetitive formatting
Meriem, a project manager at an engineering & construction (BTP) company in Algiers, applies the same preparation to every new site: standard formatting, a filter by phase and a dedicated view for the committee. This sequence of actions takes time and she sometimes forgets it. She enables the Developer tab, then records a macro: she performs the actions once, and Project captures the code. She then replays the macro on another site and measures the gain. Curious, she opens the VBA editor (Alt+F11) to read the code, changes a parameter, then assigns the macro to a button. She is not coding software: she is automating a repetitive gesture, without being a developer.
Standalone case for this section: it comes back in the lesson, the diagram, the script and the 48h challenge of section 5.5.
1. The macro recorder
For repetitive tasks, Project is automatable via VBA (Visual Basic for Applications), the same macro language as Excel or Word. The no-code entry point: the macro recorder, which captures a sequence of actions (formatting, filter, view) and replays it at will. Meriem thus obtains code that she can then reread and modify: it is the simplest way to automate without being a developer.
2. Editing VBA
Going further, you write or edit macros in the VBA editor (Alt+F11) to manipulate Project's object model: browse tasks, modify fields in bulk, produce custom reporting. Automating repetitive tasks is the last stage of the journey: saving time on the tool to focus on management. Meriem, for example, changes a parameter in the generated code, then assigns the macro to a button.
3. Automating what repeats
The golden rule: automate what is repetitive and pays off through repetition. A macro for an action done only once is pointless; for a weekly gesture (standard formatting, reporting export, bulk renumbering), it saves precious time and avoids errors. Meriem always starts with the recorder, observes the generated code to learn, then progressively automates what comes back often.
🔎 Concrete example — 🔎 Concrete example — From no-code to code
Meriem automates a repetitive preparation, first without coding:
Record: filter + formatting, once → generated code.
Replay on another project, then Alt+F11 to read the code.
→ modify a parameter, assign the macro to a button.
Result: lasting time savings in the service of management.
Reflex: VBA = same language as Excel/Word (reusable skill).
Section vocabulary
- VBA
- Visual Basic for Applications: macro language common to Office applications, allowing Project to be automated.
Simple example: Meriem automates her repetitive formatting in VBA.
What it is not: believing that Project cannot be automated.
Reflex: VBA = reusable skill (Excel/Word).
- Macro recorder
- Tool that captures a sequence of actions to replay it; it produces VBA code without having to write it.
Simple example: Meriem records filter + formatting in one go.
What it is not: wanting to code before trying the recorder.
Reflex: recording = automating without coding.
- Macro
- Program automating a repetitive task (formatting, filter, export, bulk processing).
Simple example: Meriem replays her macro on another site.
What it is not: running a macro from an unknown source without caution.
Reflex: automate what repeats.
- VBA editor
- Environment (Alt+F11) where you read, write and run macro code.
Simple example: Meriem opens Alt+F11 to modify a parameter.
What it is not: never looking at the generated code.
Reflex: read the code to learn.
- Object model
- Programmable structure of Project (Projects, Tasks, Resources, Assignments…) that can be manipulated in VBA.
Simple example: Meriem browses tasks for bulk processing.
What it is not: modifying each task by hand.
Reflex: the object model enables bulk processing.
In practice — In practice — Automate with VBA macros
- Enable the Developer tab (File > Options > Customize Ribbon) to access the macro tools.
- Record a macro: start the recorder, perform a repetitive task (filter + formatting), stop.
- Replay the macro on another project and see the time saved; open the VBA editor (Alt+F11) to read the code.
- Slightly modify the code (e.g. change a parameter) to adapt it, and assign the macro to a button to reuse it.
Step-by-step script — automate like Meriem (10 min)
1) Enable the Developer tab. 2) Start the macro recorder and give it a name. 3) Perform the repetitive task (e.g. Meriem's filter + formatting). 4) Stop recording. 5) Replay the macro on another project; measure the gain. 6) Open the VBA editor (Alt+F11), read the code, modify a parameter and assign the macro to a button. Caution: test on a copy of the file.
Start by recording, observe the code, then modify it little by little: you do not need to be a developer to begin.
Copy-paste template — my step-by-step macro
Developer tab: enabled (File > Options > Customize Ribbon)
Recorded actions: ___ (e.g. filter by phase + formatting)
Macro name: ___
Replayed on: ___ (another project) → gain: ___
VBA editor (Alt+F11): parameter changed ___ · button assigned ___
Rule: record first · edit next · automate what repeats · test on a copy.
Standard formatting
Meriem records a macro that applies the same formatting to every site.
Recurring filter
Meriem automates a filter by phase that she redoes at every progress meeting.
Custom reporting
Meriem edits VBA to generate a personalized summary table.
Bulk processing
Meriem modifies a field on hundreds of tasks at once via a macro.
✓ Best practices
- Start with the recorder (no coding), then edit the VBA.
- Observe the generated code to learn progressively.
- Automate what is repetitive and pays off through repetition.
✗ Common pitfalls
- Wanting to code VBA before trying the recorder.
- Automating an action done only once (not worthwhile).
- Forgetting that VBA reuses Excel/Word skills.
Key takeaways
- Project is automated with VBA (same macro language as Excel/Word).
- The macro recorder captures actions and replays them: automating without coding.
- The VBA editor lets you write/modify macros manipulating the object model.
- Ideal for recurring bulk processing and custom reporting.
48h challenge — apply it tomorrow
Like Meriem, record ONE macro for a task you repeat (formatting, filter, view), replay it on another project, then open the VBA editor (Alt+F11) to read the code and modify a parameter. Assign the macro to a button. Test on a copy of the file.
- I can explain what VBA is in Project.
- I know how to record a macro without writing code.
- I know how to read and modify code in the VBA editor to go further.
Frequently asked questions
Do I need to know how to program to use VBA macros?
Not to start. The macro recorder lets you automate without writing a line: you perform the actions once, Project records them as code, and you replay them. This is enough for many repetitive tasks. To go further (processing tasks in bulk, conditional logic), you need to read and modify VBA code, which requires progressive learning. VBA is the same language as in Excel and Word.
What are the typical use cases for a macro in Project?
Anything repetitive: applying standard formatting to every new project; renumbering or reordering tasks in bulk; generating a summary table or a custom export at every progress meeting; modifying a field on hundreds of tasks at once. Done by hand, these operations take time and are error-prone; a macro executes them in seconds. The return is judged by repetition.
How do you automate a repetitive task in Project?