Guild of Project Controls: Compendium | Roles | Assessment | Certifications | Membership

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

Gantt Chart Bar Colour Coding

6 replies [Last post]
James Arundell
User offline. Last seen 17 years 5 weeks ago. Offline
Joined: 19 Feb 2007
Posts: 9
Groups: None
Hi,

I’m currently trying to put together a Gantt chart in MS Project.

I would like to be able to group together similar tasks ie. Tasks representing a certain business area are listed first followed by tasks representing a different business area underneath. I would also like their corresponding bar on the gantt chart to be a particular colour dependent upon what group that task is in.

I’m fairly new to Project and the only way I can think to achieve this so far is to create a column called "Group name" with ’field name’ set to "Text1". The cell contents will then be the name of the group eg "Retail","Supply Chain" etc. I would then look to create a macro that would search the "Group name" column and then change the colour of the bar dependent upon the value in the cell eg red for "retail", blue for "supply chain" etc.

Is this possible? Am I overly complicating an easy task?

Apologies if there is a simpler way round this, however my knowledge is fairly limited! Any help would be greatly appreciated.

Thank you in advance.

Replies

Trevor Rabey
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 29 Nov 2005
Posts: 530
Groups: None
James,
Have a look at some of the formatting in some of the built in Views for clues about how to set bar styles colours for Tasks that meet certain criteria. Some of the criteria can be combinations, eg "Summary,Critical". This one makes Summary bars which have zero Total Slack go whatever colour you like. Another good one is "Milestone, Critical", which can be used to make zero total slack Milestones go red. You have to get the syntax right with the comma etc.
If you use one of the custom fields such as Flag1 you could use a combination criteria such as "Normal, Flag1".
You could use this to make all normal tasks which also have Flag1 set to "Yes" take on whatever style you choose.
You could set Flag1 by data input or you could make it a calculated result with a formula.

when you make or contemplate serious formatting changes like this it is best to make it part of a new View rather than messing up the built in View.

Once you get the hang of using the spare custom fields you can also sort, filter and group on them, so they become really important.

My VBA is pretty hopeless but I find that so much can be achieved without it that I never need it.

Exhaust the possible simple solutions before over-reaching to the complicated ones.
Glen Mettler
User offline. Last seen 16 years 7 weeks ago. Offline
Joined: 16 Feb 2007
Posts: 3
Groups: None
I use the flags, a text field I call Acro, and a cust task sheet view. The Acro field (short for Acronym) contains a short word that describes the task (ie "Conduct Thermal Test" would be "Therm Test" in Acro). I use the flag fields to indicate the type of symbol and where I want the label (left, right, top, bottom). I create a cust task sheet view to show in lower pane that displays the task, acro, dates, and flag fields (renamed as appropriate). In Bar Styles I create bars and indicators that correspond to the flags. I can then select the task and then select the flag in the task entry pane and the bar or symbol will display as appropriate and put the label either left, right, up, or down as approriate.

If you want, I can send you a project file and then we can talk on the phone. Two minutes of phone talk is much better than a couple of pages of written explanation.

Regards,

Glen
James Arundell
User offline. Last seen 17 years 5 weeks ago. Offline
Joined: 19 Feb 2007
Posts: 9
Groups: None
Thank you all for your help, I think I’m more or less there now. Fingers crossed!
James Arundell
User offline. Last seen 17 years 5 weeks ago. Offline
Joined: 19 Feb 2007
Posts: 9
Groups: None
Thanks for the help, does exactly what I need!
James Griffiths
User offline. Last seen 15 years 16 weeks ago. Offline
Joined: 19 May 2006
Posts: 435
Groups: None
Hi James,

You probably could write a macro or some sort of VB code to do as you require, but I think that you’re over-complicating things a bit (but I’m not particularly versed in the art of VB writing anyway)

I get the impression that you’ll be using the "Group By..." function in order to get the groupings that you desire. Once you have done this, then the easiest way is just to apply a filter (an Autofilter will work perfectly well), in Text1, to extract "retail" or "supply chain" values. You then just highlight all the activities, click Format>Bar>Bar Shape, and then change the colour.

HTH.

James.