Reply To: Can you custom format (in green) underallocated resources in Task Usage view?

Home Forums Discussion Forum Can you custom format (in green) underallocated resources in Task Usage view? Reply To: Can you custom format (in green) underallocated resources in Task Usage view?

#25019
Sai Prasad
Participant

Tom Mc:

Project 2010 does NOT have a feature to show Percent Allocation (in table and timephased data) below or above capacity in Task Usage view in different color. Though your requirement is on Task Usage, I would want to let you know in Resource Usage view percent allocation above capacity are displayed in Red color, which can be customized using Format tab> Text Styles > Overallocated Resources. Again, in Resource Usage there is no feature to display Percent Allocation (in table and timephased data) below capacity in different color.

In Task Usage, if you want to know the dates when the resources is assigned more or less than the capacity, you need to write a macro.

a) First, change your current view to Task Usage

b) Insert two columns on the table: Overallocated, Flag1, Notes. The Overallocated column will be true if the resource is overallocated in some day of that assignment. The Flag1 will be used by the below macro to indicate if the resource is assigned less than the capacity. The Notes field will be updated by the below macro with the dates when the resource is above and below capacity.

c) In View tab, Macros > Visual Basic. Copy the below code into the module group

Sub Show_Resource_Capacity_For_Each_Assignment()

 

Dim myProjectTask As Task

Dim myResourceAssignment As Assignment

 

For Each myProjectTask In ActiveProject.Tasks

For Each myResourceAssignment In myProjectTask.Assignments

CalculateResourceCapacity myResourceAssignment

Next myResourceAssignment

Next myProjectTask

End Sub

 

Sub CalculateResourceCapacity(myResourceAssignment As Assignment)

Dim tsv, tsvs

Dim st, fn

st = myResourceAssignment.Start

fn = myResourceAssignment.Finish

myResourceAssignment.Notes = “”

myResourceAssignment.Flag1 = False

 

Set tsvs = myResourceAssignment.TimeScaleData(StartDate:=st, EndDate:=fn, _

Type:=pjAssignmentTimescaledPercentAllocation, _

TimeScaleUnit:=pjTimescaleDays)

For Each tsv In tsvs

If (Val(tsv) < 100) Then

myResourceAssignment.Flag1 = True

myResourceAssignment.AppendNotes “Below capacity on ” & tsv.StartDate

End If

If (Val(tsv) > 100) Then

myResourceAssignment.AppendNotes “Above capacity on ” & tsv.StartDate

End If

Next tsv

End Sub

I know this is quite complex, but if your intent is to know the dates when the resource is working below and above capacity the above code should be good.

Hope this helps.