Conditional format - Color coding

N

Newbie

We have written the simple VBA codes to change the color of the text.
However, when I executed with Macros, I received an error.


"Run time error '1100'
The Method is not available in this situation"


Background -> We downloaded the file and associated that field, "Type"
with the "Text10" in Microsoft Project Professional 2007. There are
values in the "Type" field, which are "Management" and "Employee". We
would like to differentiate the colors.


The codes that we wrote were:
-------------------
Public Sub Change_Color()

Dim tskT As Task

For Each tskT In ActiveProject.Tasks

Select Case tskT.Text10


Case "Management"
SelectRow Row:=tskT.ID, RowRelative:=False
Font Color:=pjRed


Case "Employee"
SelectRow Row:=tskT.ID, RowRelative:=False
Font Color:=pjBlue

End Select

Next tskT

End Sub

------------------------

When we debugged this macros, it highlighted the line that has the
font color. We changed the number to 1 or 2, it still did not work.

Requests:

1. Can anyone assist in correcting this code?
2. In order to enhance, how can I add the background color? Will the
back color command work?

I do appreciate your response. I thought that we have almost nailed
this down. Thanks.
 
D

Dale Howard [MVP]

Newbie --

I would recommend you post your question in the
microsoft.public.project.developer newsgroup, as you are more likely to get
an answer in that newsgroup. Hope this helps.
 

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