How to Automatically Mark a Milestone Complete if All Predecessors are Complete

J

Joe Baker

Hi,

If I have a milestone, and it has one or more predecessors, how can I mark
the milestone complete when all its predecessors are complete?

It seems like a very simple thing to do, or at least something which must
have already been thought about in the past. I've searched high and low for
an answer.

Thank you!
Joe
 
J

Jan De Messemaeker

You need a VBA procedure to do so:
Select the milestone
then run followinhg macro:

Sub Mst100()
dim Job as Task
Dim Mst as task
set mst=activeselection.tasks(1)
mst.percentcomplete=100
for each job in mst.predecessortasks
if not job.percentcomplete=100 then
mst.percentcomplete=0
exit for
end if
next job
end sub

Hope this helps,
 
J

Joe Baker

Thank you for the quick reply. I will try it as soon as possible.

One last question, please. I am surprised that this is not standard
behavior in MS Project. It seems to me that a milestone should
automatically be marked complete if all its predecessors are 100% complete.
Yet MS Project does not handle this?

Thanks!
Joe
 
J

JackD

A summary task with all of its subtasks marked complete is marked complete.
They serve to summarize the status of all tasks they represent. Milestones
do not intrinsically serve as a marker of all that goes before them, thus
this behavior is not built-in, and if it were, people would be unhappy about
it :)
 
D

davegb

Jan said:
You need a VBA procedure to do so:
Select the milestone
then run followinhg macro:

Sub Mst100()
dim Job as Task
Dim Mst as task
set mst=activeselection.tasks(1)
mst.percentcomplete=100
for each job in mst.predecessortasks
if not job.percentcomplete=100 then
mst.percentcomplete=0
exit for
end if
next job
end sub

Hope this helps,
Jan, does this macro use just immediate predecessors to determine
milestone status, or all predecessors? (Been a long time since I wrote
and Project VBA)
 
J

Jan De Messemaeker

Hi Dave,

Just immediate predecessors. I had the feeling this was his question.
These immediate predecessors cannot (should not) be 100% finished if their
predecessors aren't :))
 
J

Joe Baker

Hi Everyone,

Thank you very much for the assistance. Let me provide a little background
information which might help [I should have done this sooner. :)].

I'm tracking over 100 project schedules for other people. I check items
like compliance with processes, baselines, % Complete, etc. Many times, I
have project schedules which end up with an overall % Complete of 98%
because the project managers mark all tasks 100% complete except for
milestone tasks. Don't ask me why, it's some bizarre human behavior I have
encountered. Any, until I can properly educate these people, I am stuck
with this huge data quality problem...where many projects are in reality
finished, but the project schedules say they are not finished simply because
of these incomplete milestones.

So, I need a macro to quickly search through all project schedule tasks. If
the task is a milestone, then check all of its predecessors to see if they
are 100% complete. If yes, then mark that milestone 100% complete.

I realize that simply because the predecessors of a milestone are 100%
complete does not necessarily mean that the actual milestone is 100%
complete...since the milestone date could be far in the future whereas its
predecessors might be months behind it. I figure this macro is a great
first step.

Many thanks to all!
Joe
 

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