Format by Hierarchy

E

Ed

Hello, I would like to know if it is possible to assign a "Conditional
Formatting" or something similar based on the hierarchy of the tasks. Example:

WBS - Task - [Format]
1 - CONSTRUCTION - [Arial 12, Bold, Red]
1.1 - Floor Slabs - [Arial 10, Bold, Black]
1.1.1 - 10 cms. slab - [Arial 8, none, Grey]
1.1.2 - 15 cms. slab - [Arial 8, none, Grey]

thanks
Ed
 
M

Mike Glen

Hi Ed,

Welcome to this Microsoft Project newsgroup :)

You might like to adapt FAQ Item: 37 - Custom Fields in Tables. FAQs,
companion products and other useful Project information can be seen at this
web address:http://project.mvps.org/faqs.htm

Hope this helps - please let us know how you get on :)

Mike Glen
Project MVP
 
J

Jan De Messemaeker

Hi,

Conditional formating is unfortunately very poor in Project: text styles
only exist for a few conditions (see under Format, Text Styles)

You can achieve what you need through a VBA procedure. If you're interested
I could post an example here.

HTH
 
E

Ed

Mike and Jan, thank you very much for your replies.
Jan, I don't know yet how to use the VBA, I would be very pleased if you do
post a example, it's something I've been wanting to go deeper into.

,Ed
 
J

Jan De Messemaeker

Hi Ed,

Here to give you a first taste.
To use it:
Copy the text below from Sub to and including End Sub
In Project with the project you want to color open, Alt+F11
In the top left window select ProjectGlobal
Insert, Module
Paste the text.
If you don't like the color combination change the lines Kleur(x)=
Typing pjcolor in the Object Browser (look for the button on the toolbar)
gives a list of available pjcolor constants
If you have more than 5 outline levels ... you can find the solution by now
I guess
Then in Project Tools, Macro, Macros, select this one, run

NOTE: This macro is absolutely not representative for Project VBA where
selecting something is very unusual and used solely for visual actions such
as font!

Here it comes:

Sub Mark_Color()
Dim Ctr As Integer
Dim Kleur(5) As Integer
Dim Job As Task

Kleur(1) = pjBlack
Kleur(2) = pjSilver
Kleur(3) = pjLime
Kleur(4) = pjAqua
Kleur(5) = pjRed

FilterApply "All Tasks"
OutlineShowAllTasks

For Ctr = 1 To ActiveProject.Tasks.Count
SelectRow Row:=Ctr, rowrelative:=False

If Not ActiveSelection Is Nothing Then
Font Color:=Kleur(ActiveProject.Tasks(Ctr).OutlineLevel)
End If

Next Ctr
End Sub
 

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