Final working solution:
Private Sub Project_Change(ByVal pj As Project)
' COMPLETED TASKS DISPLAY SMALL FONT
' Sets the font of a task to smaller size when it is marked 100%
' Note: this does not set the font of any already completed task
' Works by setting "Mark" property to true when
' a task is set to 100%
' Assumes Format Text Styles for Marked tasks is set to 6 points
Dim OutL As Integer 'Outline level
Dim LoopCntr As Integer 'Loop counter
Dim Tsk As Task
If Not ActiveCell.Task Is Nothing Then
Set Tsk = ActiveCell.Task
If Tsk.PercentComplete = 100 Then
Tsk.Marked = True
Else
Tsk.Marked = False ' Used if a task reset to <100%
End If
' Set summary tasks if all their subordinate tasks are complete
If Tsk.OutlineLevel <> 1 Then
OutL = Tsk.OutlineLevel - 1
For LoopCntr = OutL To 1 Step -1
Set Tsk = Tsk.OutlineParent
If Tsk.PercentComplete = 100 Then
Tsk.Marked = True
Else
Tsk.Marked = False
End If
Next LoopCntr
End If
End If
End Sub
Just in case anyone is following this, this post is to show the error of my
My solution works, as far as it goes, but it does not go far enough.
When all the sub-tasks of a given task are completed, the parent is
automatically marked 100%, but the font size is not reduced!
Jim Aksel's solution does not have this problem.
I'll keep you posted.
Moderator question: I am over the border now and should I be in the
Developers forum?
"SigR" wrote: