momcaro
11-20-2014, 07:19 AM
Hello,
I have the following code (which works) for coloring rows when tasks complete % is below the expected % complete (which is a custom field):
Sub SelectTaskRows()
Dim tskT As Task
For Each tskT In ActiveProject.Tasks
Select Case tskT.Number7
Case Is <= 0
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H9DF2BA
Case 0.1 To 30
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H46F5FF
Case 30.1 To 100
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H3760FE
End Select
Next tskT
End Sub
I would like to insert an If statement, to only color the rows green/yellow/red if the task is a milestone.
Being the VBA infant that I am, I cannot get it to work (I'm apparently missing pieces).
Could someone please help?
Thank you!
Caroline
I have the following code (which works) for coloring rows when tasks complete % is below the expected % complete (which is a custom field):
Sub SelectTaskRows()
Dim tskT As Task
For Each tskT In ActiveProject.Tasks
Select Case tskT.Number7
Case Is <= 0
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H9DF2BA
Case 0.1 To 30
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H46F5FF
Case 30.1 To 100
SelectRow row:=tskT.ID, RowRelative:=False
Font32Ex CellColor:=&H3760FE
End Select
Next tskT
End Sub
I would like to insert an If statement, to only color the rows green/yellow/red if the task is a milestone.
Being the VBA infant that I am, I cannot get it to work (I'm apparently missing pieces).
Could someone please help?
Thank you!
Caroline