PDA

View Full Version : Solved: Changing the font of one column field



nkamp
01-16-2008, 02:47 PM
Hello,

I'm trying a lot but I can't manage it. But how can you change the font in column, if you loop through the active tasks? For example I do want only change the color from the start column:


Sub SelectTaskRows()
Dim tskT As Task

SelectBeginning

For Each tskT In ActiveProject.Tasks

'This doesn't work! it jumps to the complete wrong row
SelectRow Row:=tskT.Start, RowRelative:=False
Font Color:=pjRed

'this is more or less from excel. There I can manage it but this doesn't work off course for Ms Project
'tskT.Start.Interior.ColorIndex = 39
Next tskT

End Sub

Thanks in advance

Nico

nkamp
01-28-2008, 08:15 AM
I have solved it by myself:


Sub test()
Dim ts As tasks
Dim T As Task
Set ts = ActiveProject.tasks
For Each T In ts
If Not T Is Nothing Then
T.Finish1 = T.Finish
SelectRow T.UniqueID, RowRelative:=False
SelectTaskField Row:=T.UniqueID, RowRelative:=False, Column:="start"
Font Color:=pjBlue, Bold:=True, Italic:=True
End If
Next T
End Sub


Nico

Ronald_yoh
07-03-2008, 07:15 PM
Hi mate,

I'm having the same but I can't solve with the way you did.

i'm working with the "inserted project" as summary task and selecting the ID will only create confusion to ms project (since the id is not unique and order in inserted project).

any other solutions you can think of?

Cheers
R

nkamp
07-04-2008, 10:56 AM
Hi mate,

I can't follow you. I do not understand what you mean by "inserted project". You have defined projects in you're MS Project file. The first line is called "summary" task line.

Maybe you can show me the code, or peace of the task list, so that I can see what you mean.

Nico

Ronald_yoh
07-04-2008, 06:03 PM
mate... say you have a master project (e.g. master.mpp). In this master project you insert another project as summary task (in my org, we normally call this sumarry task as inserted project).

Consider the following scenario:

---------------------------------
ID
Task Name 1 ACP-OPTUS-RENEWAL-RUN-3.4594.mpp 1 Processing
Victor
2 ACP-4X4.4611.mpp 1 Processing
Victor
3 2EVOLVE-PHONE.4599.mpp 1 Processing
Victor
-----------------------------------------

The above figure shows the ID and task name in task usage view. Sumarry task (inserted project) are ACP-OPTUS-RENEWAL-RUN-3.4594, ACP-4X4.4611.mpp, 2EVOLVE-PHONE.4599.mpp.

For each inserted project has subtask called "Processing" and "Victor" is the resource name (resource assignment).

Notice that for each subtask (processing) the ID has been reset to 1 whereas in normal task the ID is always sequentially incremented.

Take the "ACP-4X4.4611.mpp" task as example. when you execute oTask.ID, it will return "2" but this task actually in 4th row. As a result, I end up selecting "Processing" task under "ACP-OPTUS-RENEWAL-RUN-3.4594" summary task since it is in 2nd row.

So the VBA code "Selecttaskcell row:= oTask.ID" will never be working.

Hope you get the clear picture what I mean.

Cheers
R

Ronald_yoh
07-04-2008, 06:16 PM
in addition to my email above, how do you check the "nth" row of the task. Since the oTask.ID and oTask.uniqueID do not return the correct row!