完成百分比等于100时更改任务名称字体颜色 - MS Project

时间:2016-09-08 14:58:44

标签: vba macros ms-project

计划:MS Project 2013 Professional

当完成百分比等于100%时,我试图将任务名称字体颜色更改为绿色。这就是我所拥有的,但它仍然不适合我。

Sub TurnGreen100Complete()
' 100% Task Completion - Turn Green

    Dim T As Task

    For Each T In ActiveProject.Tasks
        Select Case T.PercentComplete
            Case Is = "100%"
                SelectTaskField Row:=T.Name, RowRelative:=False
                Font Color:=pjGreen
        End Select
    Next T
End Sub

1 个答案:

答案 0 :(得分:0)

尝试: Dim T As Task

For Each T In ActiveProject.Tasks
    If not t is nothing then  'Ignore blank rows
      If T.PercentComplete=100 then
          editgoto ID:=t.id
          Font Color:=pjGreen
      End If
    End IF
Next T