Formatting milestones

S

Shauno

Hi,
I have a gantt chart with essentially 2 types of milestones.
I need to be able to format some milestones to be one colour
and the other ones to be a different colour.
Although i can do this manually by formatting the individual bars
concerned, the question is how do i do it using VBA code.

Could someone please give me some sample code to
specifically format a task's gantt bar given that i have just
set it's milestone property to true.

Ps. if there's any other workaround - maybe not using milestones
then please add your thoughts.

Thanks
Shaun
 
J

JimS

How about setting up two types of milestone bar style, varying according to a
flag (that may be itself be set by a function or macro)? Take a look at the
bar style definition for the standard milestone and decide how your
alternative one differs.
 
S

Shauno

Thanks Jim.
I have tried exactly this, however when you have two types of type
milestone, then every milestone is replaces by both of them combined
eg. if one started with star and other finished with a square, then all
milestones will now start with star and end with square.
I presume this is what you were referring to.
S
 
J

JimS

Shauno,

You can put more than one item in the "Show for.. Tasks" column. E.g. Copy
the existing milestone line into a second one. For the new one, highlight
the Show for .. tasks entry (currently just milestone). Now, up on the entry
line (the one with the red cross and green tick) you should see "Milestone".
Amend this to be "Milestone, Flag10" (just put in a comma and then use the
drop down on the original "Show for.. Tasks" box to pick Flag10). Click on
the tick to confirm. The formatting for this line will now apply to tasks
that are milestones AND that have Flag10 set to true.

Give that a try.
JimS
 
J

JimS

Forgot to mention that with that extra flag entry you can control when the
star appears or not, but it will be overlayed with the original diamond
always, as the "milestone" condition will also be true. You can have it as
one or the other by having one condition being "milestone, flag10" and the
other being "milestone, not flag10". Setting flag10 will then toggle which
condition is used.

Hope that this helps
JimS
 
S

Shauno

Thanks I'll try it out

JimS said:
Forgot to mention that with that extra flag entry you can control when the
star appears or not, but it will be overlayed with the original diamond
always, as the "milestone" condition will also be true. You can have it as
one or the other by having one condition being "milestone, flag10" and the
other being "milestone, not flag10". Setting flag10 will then toggle which
condition is used.

Hope that this helps
JimS
 
J

JackD

Don't forget that the bars are drawn in the order listed in the barstyles.
The later rows will be drawn on top of the earlier ones. At times this can
hide the ones earlier in the list (sometimes this is a good thing)
 

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