change color of task font to show when it is overdue

R

Roy Bernal

Is there a way to highlight or possibly change the font to say...RED, to show
that it is overdue. I want the font in the entire row to be RED when it is
overdue, and then maybe Blue or green when it is not due yet or Yeallow when
it is within a day or two, etc...There has to be an easy way to do this right?
 
G

Gérard Ducouret

Hello Roy,

This can only be done with VBA

Gérard Ducouret

Roy Bernal said:
Is there a way to highlight or possibly change the font to say...RED, to show
that it is overdue. I want the font in the entire row to be RED when it is
overdue, and then maybe Blue or green when it is not due yet or Yeallow when
it is within a day or two, etc...There has to be an easy way to do this
right?
 
J

JackD

You can use an indicator in a custom field to do this, but formatting the
text is a different and more difficult proposition.
To use an indicator, insert an unused custom field column (Text1-Text30 or
the like)
Write a formula to return a value if the task is overdue (google this
newsgroup for examples or read this article:
http://zo-d.com/blog/archives/programming/working-with-custom-field-formulas.html
Then in the customize fields dialog box, set the indicator and criteria you
want.

--
-Jack ... For Microsoft Project information and macro examples visit
http://masamiki.com/project
or http://zo-d.com/blog/index.html
..
Roy Bernal said:
Is there a way to highlight or possibly change the font to say...RED, to show
that it is overdue. I want the font in the entire row to be RED when it is
overdue, and then maybe Blue or green when it is not due yet or Yeallow when
it is within a day or two, etc...There has to be an easy way to do this
right?
 
J

Jan De Messemaeker

Hi Tina,

How can WHAT exactly be done?
The whole logic or just how can you change the font of a given task with
VBA?

Let me help you with the latter
--------------------------------------
FilterApply "All tasks"
OutlineShowAllTasks

for each job in activeproject.tasks
if not job is nothing then
......
'Here comes the logic to decide which color you want the text to be
....

SelectRow Row:=job.id, rowrelative:=false
Font Color:=pjFuchsia 'for instance

end if 'is nothing
next job
 
G

Gérard Ducouret

Tina,
An example of what you can do :
Gérard Ducouret
----------------------------
Sub TaskColor()
Dim oTask As Object

For Each oTask In ActiveProject.Tasks
Debug.Print oTask.Name, oTask.ID, oTask.FinishVariance /
((ActiveProject.HoursPerDay) * 60)
If Not oTask Is Nothing Then
If oTask.Summary = False Then
If oTask.FinishVariance / ((ActiveProject.HoursPerDay) * 60) > 1
Then 'If the finish variance is greater than 1 day(s)
SelectRow Row:=oTask.ID, RowRelative:=False
Font Color:=pjRed
ElseIf oTask.FinishVariance / ((ActiveProject.HoursPerDay) * 60)
< 0 Then 'in advance
SelectRow Row:=oTask.ID, RowRelative:=False
Font Color:=pjGreen
Else
SelectRow Row:=oTask.ID, RowRelative:=False
Font Color:=pjBlack
End If
End If
End If
Next oTask
End Sub
 
T

Tina S

Sorry for being so vague.

I am a complete newbie with Macro use with Project. I have a programming
background (with a very early version of VB) so it should be easy to learn.

So I guess I was looking for a primer on getting started with VBA used with
project. Is there anything that is recommended?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top