VBA task status help

C

Chris

Hi all.

I want to add some VBA which runs through each task / line in the plan and
looks at what should have started or finished against % complete and if late
turns the task
line red...

Can anyone point me in the right direction please...

Chris
 
J

Jan De Messemaeker

Hi,

Filterapply "All Tasks"
outlmineshowalltasks
selectall
myrows=activeselection.rows.count
selectbeginning
for ctr=1 to rows
set thejob=activeselection.tasks(1)
' Follow the conditions to set the color
If thecondition then
font ... color red
else
font... color black
end if
selectrow 1
next

HTH
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
C

Chris

Hi there..

Have tried this but is does not work problems with selecting active row and
also with font colour!

Sub test()
Dim pTask As Task
Dim myrows As Integer
Dim myDate As Date
myDate = Date

FilterApply "All Tasks"
OutlineShowAllTasks
SelectAll
For Each pTask In ActiveProject.Tasks
If pTask.Start <= myDate And pTask.PercentComplete = "0" Then '.... it
should have started
SelectRow.qtasks
pTask.FontColor = red

Else
pTask.FontColor = black
End If

Next pTask

End Sub
 
J

Jan De Messemaeker

Dear Chris,

Here's what you asked for:

" Can anyone point me in the right direction please..."
That's what I did.

Up to you to finish the job.
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
C

Chris

Hi Jan...

Couldn't get your guidance to work so tried some other things which as
happened don't work either.

I'll keep trying and repost when I win!

thx
 
J

JulieS

Hi Chris,

I don't have Project here at the moment, but I think the way to change color
is:

Font color := pjRed

Try looking at help for color.

Sorry, I can't test the code but I think if you try combining Jan's ideas
with the setting above you may have success.

I hope this helps.

Julie
 

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