Change Multiple Tasks Text Colour at same time in Microsoft Project

While you can set Gantt Chart Bar Styles to automatically change colours based on defined conditions or criteria, you cannot do same with Text Styles (to best of my knowledge).

So, when a visitor to my YouTube channel requested a tutorial on how to auto-change text colour for tasks that are 100% complete, the best I could come up with, is to run a simple macro. And the video below contains the code and the steps to follow.

If prompted the next time you open the Project file, you can click the Enable Macros button.

10-Dec-23 Addendum

One of the visitor’s to my YouTube requested the code for updating the colour of cells of specific columns of a View based on the percent complete status of a task (i.e. %, Start & Finish columns) .

The code below is a solution I have come up and I must confess, it is not the most efficient code but it is a quick solution that works.

Sub ColumnColourChange()
    'Declare variable
    Dim tsk As Task
    
        Application.ScreenUpdating = False
    
    'Loop through all tasks
    For Each tsk In ActiveProject.Tasks
        If Not tsk Is Nothing Then ' ignore blank rows
        
            Find Field:="Unique ID", Test:="equals", Value:=tsk.UniqueID
            
            'For completed tasks
            If ActiveCell.Task.UniqueID = tsk.UniqueID And tsk.PercentComplete = 100 Then
                'select and colour "%", "Start" & "Finish" cells of task, i.e. 3rd, 5th & 6th columns
                SelectCell Column:=3
                Font32Ex Color:=RGB(0, 0, 0), CellColor:=RGB(143, 206, 0)

                SelectCell Column:=5
                Font32Ex Color:=RGB(0, 0, 0), CellColor:=RGB(143, 206, 0)

                SelectCell Column:=6
                Font32Ex Color:=RGB(0, 0, 0), CellColor:=RGB(143, 206, 0)
                
            'For in-progress tasks
            ElseIf ActiveCell.Task.UniqueID = tsk.UniqueID And tsk.PercentComplete < 100 And tsk.PercentComplete > 0 Then
                'select and colour "%" & "Start" cells of task, i.e. 3rd & 5th columns
                SelectCell Column:=3
                Font32Ex Color:=RGB(0, 0, 0), CellColor:=RGB(255, 191, 0)

                SelectCell Column:=5
                Font32Ex Color:=RGB(0, 0, 0), CellColor:=RGB(143, 206, 0)
            End If
            
        End If
    Next tsk
    
    Application.ScreenUpdating = True

End Sub
Previous
Previous

Check for Non-ASAP Constraint Type in Microsoft Project

Next
Next

How to Produce a Report in Primavera P6 with Baseline Details for Multiple Projects