Hallo again,
I use the following code for calculating the total work of a resource group in a Gantt Chart field.
------------------------------------------------------------------------------------------------------------------------
Public Sub GetCoreWork()
Dim Task As Task
Dim Resource As Resource
Dim CoreWork As Double
Dim Assignment As Assignment
For Each Task In ThisProject.Tasks
If Task.OutlineChildren.Count = 0 Then
With Task
CoreWork = 0
For Each Resource In Task.Resources
For Each Assignment In Task.Assignments
If ThisProject.Resources(Assignment.ResourceName).Group = "Core" Then
CoreWork = Assignment.Work
End If
Next
Task.Number1 = CoreWork / 480
Next
End With
End If
Next
End Sub
------------------------------------------------------------------------------------------------------------------------
Unfortunately, if there is more than one resources assign to a task (of the same resource group) the code writes only the work of one resource, not the sum of the total work of group Core (total work of all persons of group Core, assign to the specific task).
Could you please help me with this ?
Where did i go wrong ?
Thanks in advance again !
Nora
I use the following code for calculating the total work of a resource group in a Gantt Chart field.
------------------------------------------------------------------------------------------------------------------------
Public Sub GetCoreWork()
Dim Task As Task
Dim Resource As Resource
Dim CoreWork As Double
Dim Assignment As Assignment
For Each Task In ThisProject.Tasks
If Task.OutlineChildren.Count = 0 Then
With Task
CoreWork = 0
For Each Resource In Task.Resources
For Each Assignment In Task.Assignments
If ThisProject.Resources(Assignment.ResourceName).Group = "Core" Then
CoreWork = Assignment.Work
End If
Next
Task.Number1 = CoreWork / 480
Next
End With
End If
Next
End Sub
------------------------------------------------------------------------------------------------------------------------
Unfortunately, if there is more than one resources assign to a task (of the same resource group) the code writes only the work of one resource, not the sum of the total work of group Core (total work of all persons of group Core, assign to the specific task).
Could you please help me with this ?
Where did i go wrong ?
Thanks in advance again !
Nora