Sep 15 2022 05:27 AM - edited Sep 15 2022 05:30 AM
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 case, 4.
I tried this, but it didn't work:
I created 4 resources in the "Resource Sheet" and added the value 1 to the "Number 1" field and all 4 resources are in the same Group.
Next, in the Gantt view, I add the column with choice Number 1 and modified it, like so:
https://docs.microsoft.com/answers/storage/attachments/239762-image.png
How can I do this?
Thanks all for any suggestions.
Sep 15 2022 07:06 AM
Sep 15 2022 08:01 AM - edited Sep 15 2022 08:03 AM
Hi@John-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
Sep 15 2022 08:06 AM
SolutionSep 15 2022 08:06 AM
Solution