How to Show the Number of Resources Assigned to Each Microsoft Project Task
Question details
The user needs a method to calculate and display the specific number of resources assigned to individual tasks in Microsoft Project, rather than viewing the project-wide resource total.
- Product
- Microsoft Project Online
- Device & OS
- not provided
- Scenario
- Managing task assignments and attempting to track the exact resource allocation count per task in Project Online.
- Observed behavior
- The user requires a custom field or view setup to show the exact resource count per task, which is not displayed in a flat column by default.
Before you begin, ensure you have the Developer tab enabled in Microsoft Project if you plan to use the VBA method, and identify an unused custom Number field (such as Number1) to store your assignment counts.
Use a VBA Macro to Calculate Task Assignment Counts
The most precise way to show the number of resources assigned to each task is by using a short VBA macro to populate a custom Number field.
Microsoft Project does not have a default column that simply counts the resources per task. A simple VBA script can iterate through your project and count the assignments, placing the total into a custom field of your choice.
Open your project in Microsoft Project and press Alt + F11 to launch the Visual Basic for Applications (VBA) Editor.
In the VBA Editor, click on 'Insert' in the top menu and select 'Module' to create a blank script window.
Write a VBA script that loops through each task in the active project and sets a custom field, such as Number1, to equal the value of 'Task.Assignments.Count'.
Press F5 or click the 'Run' button to execute the macro. The script will automatically calculate and populate the custom field with the resource count for each task.
Return to your Gantt Chart view, right-click on a column header, select 'Insert Column', and choose 'Number1' (or your chosen field) to view the assignment counts.
Use Grouping and Assignment-Related Fields
If you prefer not to use VBA, you can modify your view by grouping assignments to manually track resource distribution.
Manage Tasks and Resources Easily with WPS Spreadsheet
While Microsoft Project offers advanced VBA macros for resource management, it can be expensive and complex. If you need a simpler way to track tasks and assign resources, WPS Office is a free, lightweight alternative. You can easily manage project resource counts using pivot tables and functions in WPS Spreadsheet.
- 1. Create a Task Tracker: Open WPS Spreadsheet and list your project tasks in one column, and assigned resources in the adjacent column.
- 2. Use the COUNTIF Function: Use the =COUNTIF() formula to automatically tally the number of times a task appears, giving you an instant resource assignment count.
- 3. Visualize with Pivot Tables: Select your data and insert a Pivot Table to group tasks and sum up resources dynamically without any complex VBA coding.

Frequently Asked Questions
Can I show resource counts in Microsoft Project without using VBA?
Yes, you can use built-in views like Task Usage and apply custom grouping by Task Number. However, this will simply organize the view visually and won't populate a single column with a flat count number like a VBA macro does.
Which custom field should I use for the VBA macro?
You can use any standard Number field available in Project, such as Number1 through Number20. Ensure the field you choose isn't already being utilized for other project formulas or integrations.
Does the VBA macro automatically update when I add new resources?
No, standard VBA macros need to be re-run manually every time you add or remove a resource assignment. To make it automatic, you would need to attach the macro code to a specific event trigger (like Project_Change) in the VBA editor.




