John, help!
I've been using your VBA code for counting the number of resources:
Sub ResCount()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
t.Number1 = t.Assignments.Count
End If
Next t
End Sub
Which works great to count the number of resources assigned to a task.
However, I have one resource assigned to a task but with the units set to say 200%.
I want to count the maximum resource units and display them in a column. For example, in a task gannt with a resource set at 200% I want a column to display the answer as 2. Is this possible?
Thanks
Stuart
John wrote:
Re: Resource Count Field
07-Jun-07
Robert
You're welcome and thanks for the feedback
John
Previous Posts In This Thread:
Resource Count Field
I need to display a column in the Gantt chart table that shows th
resource count for each task. Ive been trying to create a custo
field but there does not seem to be a "Count" function in the formul
builder. Searching the forums, I see that in VB
"Task.Resources.Count" can be used. Is it possible to use thi
somehow in the formula builder, or to make it a custom function as i
excel VBA?
Re: Resource Count Field
Robert
Is it possible, no. However, the following simple VBA macro will do what
you want. I chose to dump the count into the spare Number1 field
Sub ResCount(
Dim t As Tas
For Each t In activeproject.Task
If Not t Is Nothing The
t.Number1 = t.Assignments.coun
End I
Next
End Su
Hope this helps
Joh
Project MVP
Thanks John, that worked nicely!
Thanks John, that worked nicely!
Re: Resource Count Field
Robert
You're welcome and thanks for the feedback
John
Submitted via EggHeadCafe - Software Developer Portal of Choice
Book Review: C# 4.0 In a Nutshell [O'Reilly]
http://www.eggheadcafe.com/tutorial...-a2da-88dde2e6d891/book-review-c-40-in-a.aspx