Article ID: 137744
Article Last Modified on 1/19/2007
Sub DrivingResource()
'If no resources, end macro
If ActiveCell.Task.Assignments.Count = 0 Then
MsgBox "Task" & ActiveCell.Task.ID & _
" has no resources assigned to it."
End
End If
'Find largest work/units.
For Each RA In ActiveCell.Task.Assignments
If (RA.Work / 60) / RA.Units > LgWrkUnits Then
LgWrkUnits = (RA.Work / 60) / RA.Units
End If
Next
'Different messages for fixed duration versus resource driven tasks.
If ActiveCell.Task.FixedDuration Then
temp = "Task " & ActiveCell.Task.ID & _
" is Fixed Duration. If the task duration type is changed to" _
& " Resource Driven, the task will have a duration of " _
& Format(LgWrkUnits, "0.00") & _
"h and be driven by the following resources:" & Chr(13)
Else
temp = "Task " & ActiveCell.Task.ID _
& " has a duration of " & Format(LgWrkUnits, "0.00") & _
"h and is driven by the following resources:" & Chr(13)
End If
'Find which resource assignments share the largest work/units.
For Each RA In ActiveCell.Task.Assignments
If (RA.Work / 60) / RA.Units = LgWrkUnits Then
temp = temp & Chr(13) & "ID: " & RA.ResourceID & _
" Name: " & RA.ResourceName
End If
Next
MsgBox temp
End Sub
95690 Delaying Resources Does Not Change Task Duration
Keywords: kbcode kbhowto KB137744