I found a logic error in yesterday's post. The macro I gave you earlier will
die on external depencies. Also, the logic is flawed but the results are OK.
For example, the other post attempts to expand tasks that are not summaries
..... that's dumb.
This one is more complete. It considers cross linking between files
(external predessors and successors). To be totally nuts, I also forced it
to respect the method of Earned Value. This was not extra work, I had to do
this for another assignment anyway. See if this one get's me another check
mark (hee hee):
Public Sub CollapseComplete()
Dim tsk As Task
For Each tsk In ActiveProject.Tasks
If Not tsk Is Nothing Then 'ignore blank lines
If tsk.ExternalTask = False Then 'skip external tasks
If tsk.Summary = True Then
Select Case ActiveProject.DefaultEarnedValueMethod
Case pjPercentComplete
If tsk.PercentComplete = 100 Then
tsk.OutlineHideSubTasks
Else
'task is not complete
tsk.OutlineShowSubTasks
End If '%Complete check
Case pjPhysicalPercentComplete
If tsk.PhysicalPercentComplete = 100 Then
tsk.OutlineHideSubTasks
Else
'task is not complete
tsk.OutlineShowSubTasks
End If '%Complete check
End Select
End If 'Summary line check
End If 'external tasks
End If 'blank line
Next
End Sub
--
If this post was helpful, please consider rating it.
Jim
It's software; it's not allowed to win.
Visit
http://project.mvps.org/ for FAQs and more information
about Microsoft Project