selecting cells or taskfields

S

Steve

I am trying to write a script that will evaluate the value of the cell and
then change its color based on that value. The problem Im having is that I
can't select that cell to change its color.

Dim T As Task

For Each T In ActiveProject.Tasks
If Not T.Summary Then
If T.PercentComplete > 0 Then
[This is where I would need to select the %complete task field]

Once I can get the right cell I can continue with the color change.
Thanks for any help

the rest I can
 
J

Jan De Messemaeker

Hi Steve,

It's dangerous to approach this by each task as there is no strong link
between task ID and Rownumber
I personally approach this as follows:

Filterapply "All Tasks"
Outlineshowalltasks
selectall
Rows=activeselection.tasks.count
selectrowstart
ctr=1
do while not ctr>rows
set T=activeselection.tasks(1)
....test
.... you now have the task's row and can select the field
'Go to next row
selectrow row:=1,rowrelative:=true
ctr=ctr+1
loop

Hope this helps,


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

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