Home > Net >  Can I use Conditional Formatting in MS Project to change text color based on Task Name Text?
Can I use Conditional Formatting in MS Project to change text color based on Task Name Text?

Time:10-05

In MS Projects, I need to utilize VBA to conditionally format all rows with "payment" somewhere in the Task Name to have bold, red text.

CodePudding user response:

This code should do what you want.

Option Compare Text
Sub BoldRed()
OutlineShowAllTasks
FilterEdit Name:="temp", taskfilter:=True, create:=True, overwriteexisting:=True, FieldName:="Name", test:="contains", _
    Value:="payment", ShowInMenu:=False, showsummarytasks:=True
FilterApply Name:="Temp"
SelectTaskColumn Column:="name"
Font32Ex Bold:=True
Font32Ex Color:=255
FilterApply Name:="all tasks"
OrganizerDeleteItem Type:=pjFilters, FileName:=ActiveProject.Name, Name:="temp"
            
End Sub
  • Related