Gantt Chart Bar Colour Coding

Member for

18 years 8 months

Thank you all for your help, I think I’m more or less there now. Fingers crossed!

Member for

19 years 11 months

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.

Member for

18 years 8 months

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

Member for

22 years 9 months

James(s),

Add a text column in the Gantt Chart table and enter the "group" name for each task, as James describes

Go to Tools, Customize, Fields, and create a formula that says "if ’group’ = ’supply’ then indactor1 = ’yes’" and so on for the other goup names

Go to Format, Bar Styles, and create new bars that represent "norma, critical, indicator1" and so on

This way, as soon as you select a particular group name for a task, the bar color will change accordingly.

Good work,

Alexandre

Member for

19 years 5 months

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.