Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asigning color to each resource

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
Hello there, hopefully one of you Project guru's will be able to help me with this.

I want to assign a particular color to each of my resources in my project (each resource is an individual person in this case) I'd like to see the resources name highlighted in the specified color in the Gannt chart view (the actual chart, rather than the tasks list on the left-hand side).

Also, is there a way to do the same thing but with groups? ie assign each resource to a group, and then assign a colour to the group.

thanks for any help anyone can give me!
 
No and No.

MS Project is a work tool for managing projects.

MS Paint is a play tool for managing colours.

 
Conditional bar colors are easy (if a few steps) Text is not (even in VBA) ...

For the bars (in Project 2000 and later) Right click on any column heading, choose customise fields...select a flag field (easiest, others need an IIF function) then the formula button - Use [Resouce Name]="Whomever" - (major downside is one Flag is needed for each resource).
With the flags set up Use Format Bar Styles, Scoll to the bottom and add a new bar style for each resource, "Show for..." Flag 1,2, etc and From - Start, To - Finish. You will also need to remove the default task bar style (takes priority) - Do use a copy of Gantt rather than original (the Gantt chart wizard will rebuild defaults if you don't like this)

The Code solution - (Excuse silly examples)

Sub CondResourceBars()
Dim t As Task
For Each t In ActiveProject.Tasks
msg = t.ResourceNames
MsgBox (msg)
Select Case Trim(t.ResourceNames)
Case "Fred Flintstone"
GanttBarFormat TaskID:=t.ID, Reset:=True
GanttBarFormat TaskID:=t.ID, MiddleColor:=pjRed, StartColor:=pjRed, EndColor:=pjRed
Case "Barney Rubble"
GanttBarFormat TaskID:=t.ID, Reset:=True
GanttBarFormat TaskID:=t.ID, MiddleColor:=pjLime, StartColor:=pjLime, EndColor:=pjLime
Case Else
GanttBarFormat TaskID:=t.ID, Reset:=True
GanttBarFormat TaskID:=t.ID, MiddleColor:=pjBlue, StartColor:=pjBlue, EndColor:=pjBlue
End Select
Next t
End Sub

The text unfortunatly a global option, more like the view formatting of Outlook - we can change what text is displayed ( LeftText:="yadda, yadda" , RightText:="etc, etc") but no conditional bar text colors.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top