SAFDF said:
I am using the Timescaledata export routine originally poster on one of the
sites. I am using:
For Each Tsv In ActiveProject.ProjectSummaryTask.TimeScaleData( _
StartDate:=ActiveProject.ProjectStart, _
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjAssignmentTimescaledWork, _
TimescaleUnit:=pjTimescaleMonths, _
Count:=1)
and get a month by month listing of each resource and the listing of each
task and effort.
Resource Name Task Name 7/1/2004 8/1/2004 9/1/2004
------------------------------------------------------------------------------
--------------
Dorantes; Rafael Project Start-Up 9 2 0
Dorantes; Rafael Plan for Workshop including core Resources 0.4 0 0
Dorantes; Rafael Project Plan 0.4 0 0
Dorantes; Rafael Risk Analysis Workbook 0.666666 0 0
Dorantes; Rafael Project Estimating & Planning Workbook 0.375 0.158 0
Dorantes; Rafael QA Plan 1 0.333333333 0
THe problem I'm trying to solve is can I get a man month equivilant total
by task? SO I would then get something like;
Task Name 7/1/2004 8/1/2004 9/1/2004
Project Start-Up 3 3 1
Risk Analysis 14 22
10
Is this possible to extract?
Jeff
Jeff,
Sure, no problem. With VBA you can get anything you want (just like
Alice's restaurant). I will assume you want to calculate equivalent
heads based on the project calendar as opposed to a generic 20 days per
month. The following code should give you what you need (if I understand
your need correctly).
Sub EquivHeads()
For Each t In ActiveProject.Tasks
If Not t Is Nothing And t.Summary = False Then
First = t.Start
Last = t.Finish
Yr = Year(t.Start)
mo = Month(t.Start)
Set taskhrs = t.TimeScaleData(First, Last, _
Type:=pjTaskTimescaledWork, _
timescaleunit:=pjTimescaleMonths)
For i = 1 To taskhrs.Count
GoSub WrkHrsMonth
EqHds = taskhrs(i).Value / 60 / 8 / WkDay
'[put the above value in Excel]
If mo = 12 Then
mo = 1
Yr = Yr + 1
Else
mo = mo + 1
End If
Next i
End If
Next t
Exit Sub
WrkHrsMonth:
WkDay = 0
Set ThisMo = ActiveProject.Calendar.Years(Yr).Months(mo)
For j = 1 To ThisMo.Days.Count
If ThisMo.Days(j).Working = True Then WkDay = WkDay + 1
Next j
Return
End Sub
I only gave it a quick test on a task that spans 2004/2005 so I won't
guarantee it's totally bug free but it should be pretty close. If I were
doing this for myself I would probably create an array for all working
day values in the project so they wouldn't need to be calculated over
and over for each task. But then, that's another story.
John
Project MVP