Re: Changing Colors of Task Names by Mark
Mark
Wed Feb 25 18:26:26 CST 2004
Try this...
Mark
Option Explicit
Sub Macro1()
Dim Activity As Task
Dim TheProject As Tasks
Set TheProject = ActiveProject.Tasks
For Each Activity In TheProject
SelectTaskColumn Column:="Name" ' put active cell in the right column
If Not (Activity Is Nothing) Then ' verify task exists
If Not Activity.ExternalTask Then ' ignore external tasks
If Not Activity.Summary Then ' Ignore summary tasks
If Activity.Critical = True Then ' True so make it red
SelectCell Row:=Activity.ID
Font Color:=pjRed
Else ' false so make it black
SelectCell Row:=Activity.ID
Font Color:=pjBlack
End If ' critical task
End If ' summary task
End If ' external task
End If ' task is nothing
Next Activity
End Sub
--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________
The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.
- Sir John Harvey-Jones
"Joe" <mismanjo@comcast.net> wrote in message
news:1aa501c3fbf0$6db04fe0$a101280a@phx.gbl...
> Does anyone know a way to change the color of the task
> name based on a test of a flag field?
>
> As an example if the flag field had either 1,2 or 3
> assigned to it....Is there a way to print 1's in red, 2's
> in blue etc.? I realize the bar on the gantt can be
> changed but I would like to change the color of the task
> name to further highlight tasks that are critical in
> nature.