Forum Discussion
Mino_DC
Sep 15, 2022Copper Contributor
Project Pro 2021 - Add column with total resources number
I would like to add a column with the total number of resources in the Gantt view. If I add 4 resources for a specific task, I would like to see in the column, the sum of the resources ... in this ...
- Sep 15, 2022Mino_DC,
You're welcome and thanks for the feedback. Obviously I wrote both macros, one counts all assignments while the other is focused on only work type resources. I'm glad you found the one that works for you.
John
Mino_DC
Sep 15, 2022Copper Contributor
HiJohn-project thanks for your reply.
With this macro I not obtain that I would like.
Based on your description, I found this article:
where you have written this solution:
Sub CountWorkRes()
Dim t As Task
Dim a As Assignment
Dim i As Integer
For Each t In ActiveProject.Tasks
i = 0
If Not t Is Nothing Then
For Each a In t.Assignments
If a.ResourceType = pjResourceTypeWork Then i = i + 1
Next a
t.Number1 = i
End If
Next t
End Sub
I added a Number1 column in Gantt view and next run macro.
This Macro works for me....
Thanks
John-project
Sep 15, 2022Silver Contributor
Mino_DC,
You're welcome and thanks for the feedback. Obviously I wrote both macros, one counts all assignments while the other is focused on only work type resources. I'm glad you found the one that works for you.
John
You're welcome and thanks for the feedback. Obviously I wrote both macros, one counts all assignments while the other is focused on only work type resources. I'm glad you found the one that works for you.
John