how to filter tasks relating to one task

W

Wendy K

HI there

I would like to create a filter that asks me for a task name then displays
the task together with its predecessors and successors.
I only want to enter the task ID number once - I am having to ask the same
question 3 times - i.e. enter the same task ID in order to see the task
itself, its predecessors and its successors.
Is this possible?
 
J

Jan De Messemaeker

Hi,

You need to run a VBA macro to achieve this.
Here's some help
Create a filter with as only condition Flag7 equals True
Call it DepFilter
Install and run this macro:

Sub ForWendy
Dim Job as task
Dim Base as task
for each job in activeproject.tasks
if not job is nothing then
job.flag7=false
end if
next job
set base=activeselection.tasks(1)
base.flag7=true
for each job in base.predecessortasks
job.flag7=true
next job
for each job in base.successortasks
job.flag7=true
next job
filterapply "DepFilter"
end sub

Hope this helps,
 
W

Wendy K

Jan

thank you! It worked, but the filter should read "Flag7 equals Yes" not
"True" which didn't work.

Thanks for your help!
 
J

Jan De Messemaeker

Hi Wendy,

My pleasure, and sorry for the little messup (in VBA it is True you need)
 
J

JackD

A built-in way of doing this is to go to windows menu / split screen, then
click on the bottom screen and from the view menu choose the "Relationship
diagram.

A more complete form of the macro Jan gave you can be found here:
http://masamiki.com/project/macros.htm - look for the trace macro.
 

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