MikeRoosevelt
Mon Oct 31 12:08:59 CST 2005
That was great. Thanks, it's working fantastic now.
"Jan De Messemaeker" wrote:
> Hi,
>
> Sorry, that's what you get from publishing code without testing...
> Following the line set suc= add this line:
> suc.percentcomplete=0
>
> Hope this helps,
>
> --
> Jan De Messemaeker
> Microsoft Project Most Valuable Professional
>
http://users.online.be/prom-ade/
> +32-495-300 620
> "Mike Roosevelt" <MikeRoosevelt@discussions.microsoft.com> schreef in
> bericht news:2E680FDB-13F5-4688-8B95-547CF3929B41@microsoft.com...
> > Thanks! That works almost perfectly! Not knowing anything about VBA I
> don't
> > know how to fix it. So in my example, Task A has 6 predecessor tasks.
> That
> > would be 16.7% for completion of each. When I check off predecessor 1 as
> > being 100% complete and run the macro, I get 17% - this is good. However,
> > when I have 2 complete predecessor tasks, it rises to 51% (should be
> 33-34%).
> > When I have 3, I get a bug that says "invalid percent complete" and
> brings
> > me to the line:
> >
> > suc.percentcomplete=suc.percentcomplete+step
> >
> > Is there something in this line I need to change? When I end the debugger
> > at this point, I see that the percent complete of Task A has risen to 85%
> > (here is where it should be 50% as 3/6 tasks are marked complete)
> >
> > Thanks,
> > Mike
> >
> > "Jan De Messemaeker" wrote:
> >
> > > Hi,
> > >
> > > This is about the same macro I wrote earlier this week for the automatic
> > > completion of a milestone.
> > > Here is a version (I put % complete to vary linearly by number of tasks
> > > complete; it could be by duration or work of course)
> > > Select the successor then run the macro.
> > > Hope this helps,
> > >
> > >
> > > Sub SucComp()
> > > dim Job as Task
> > > dim step as single
> > > Dim Suc as task
> > > set suc=activeselection.tasks(1)
> > > step=100/suc.predecessortasks.count
> > > for each job in suc.predecessortasks
> > > if job.percentcomplete=100 then
> > > suc.percentcomplete=suc.percentcomplete+step
> > > end if
> > > next job
> > > end sub
> > >
> > >
> > > --
> > > Jan De Messemaeker
> > > Microsoft Project Most Valuable Professional
> > >
http://users.online.be/prom-ade/
> > > +32-495-300 620
> > > "Mike Roosevelt" <Mike Roosevelt@discussions.microsoft.com> schreef in
> > > bericht news:82AB080C-7D01-47AD-8C9E-33B0F85786F1@microsoft.com...
> > > > I am attempting to drive completion of a task by marking the
> completion of
> > > > its predecessor tasks. That is, given task A with predecessors 1-8, I
> > > would
> > > > like task A to show incremental increases in completion % whenever I
> check
> > > > off one of the predecessor tasks as 100% complete. Is this possible
> to do
> > > or
> > > > could someone help me write a macro for it?
> > > > Thanks!
> > > > Mike
> > >
> > >
> > >
>
>
>