View Single Post
 
Old 11-28-2015, 08:31 AM
bootneck bootneck is offline Windows 8 Office 2013
Novice
 
Join Date: Nov 2015
Posts: 2
bootneck is on a distinguished road
Question How to color task according to % complete

I have used Project for Windows since its first release back in 1990 but I have never had reason to program any extensions to it - until now. I need to set the color of a task according to various parameters, one of which is % Complete (entered manually, not calculated from other data).

I am aware of using the Marked field to color a task but this is insufficient as it's a simple binary switch.

I am running into two issues:

1. I am not sure that I am coding correctly - here is what I have tried though the Debugger doesn't like the field name:

Sub ColorFormatOL()
Dim t As Task
Dim i As Integer

i = 1
For Each t In ActiveProject.Tasks


SelectRow row:=i, rowrelative:=False

Select Case t.PercentWorkComplete
Case Is = 0
Font32Ex CellColor:=&HB37F15
Case Is > 0
Font32Ex CellColor:=&HD6982E
Case Is = 100
Font32Ex CellColor:=&HF6BE41


End Select

i = i + 1
Next t
End Sub


2. I have looked all over the web for a formal list of actual object field names within Project but can find only explanations of the fields rather than the actual characters I need to type to invoke those fields


Any help would be much appreciated.

Thank you...... Bootneck
Reply With Quote