Filtering Completed Summaries

E

ET902

I'm sure i can do this. I think I have even done it before but can't remeber
the logic. I want to collapse all completed summaries, but for the summaries
that are not completed I want to show ALL of the tasks under that
summary...even the completed ones. Any ideas on how I structure the filter. I
know you guys have some.

Thanks,
Eddie
 
J

Jim Aksel

Public Sub ColapseSummary()
Dim tsk As Task
Here is a Macro that will do it for you.

For Each tsk In ActiveProject.Tasks
If Not tsk Is Nothing Then
If tsk.Summary = True And tsk.PercentComplete = 100 Then
tsk.OutlineHideSubTasks
Else
tsk.OutlineShowSubTasks
End If
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
 
J

Jim Aksel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top