Re: Keep Task Days Together

Tech-Archive recommends: Fix windows errors by optimizing your registry



In article <5D67437A-2296-4CB6-8A8A-E670A4A6D8F5@xxxxxxxxxxxxx>,
"MSPuser" <MSPuser@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> John,
>
> Thank you for your reply and pointing me in the direction of using a macro.
>
> Here is a clarification to some of your points:
> <<You have a very unique scheduling need.>> - Actually it is pretty common
> in electric industry where many tasks can only be performed in spring or fall
> when the electric demand is lower.
>
> <<whoever is going to do the task will NOT be able to just
> pick it up and start working on Sept. 1. Very likely there will be some
> prep work>> - Yes, it will be. In our case the prep work will include some
> construction that will be done by a different crew and can be done at any
> time before the electric crew does their work in spring or fall. In fact it
> is a possible delay in construction in May that could move it successor, the
> electric work, forward to September 1.
>
> << it is possible if a simple VBA macro is used to automatically adjust the
> schedule.>> - Thank you. How would it work? For example, add a lag of 3
> months and several days to assure that the electric work starts on September
> 1 if MS Project initially scheduled it to start in May and end in September?
> Please note that we have a multiyear project with hundreds of tasks. Then
> next time there are some schedule changes Project would need to delete all
> previously added lags, recalculate the new ones and add them back (?) Please
> advise.
>
> Unfortunately I have never tried writing a VBA macro in MS Project. I would
> appreciate a reference to a good source.
>
> Thank you again.
>
> MSPuser

MSPuser,
I understand your special circumstances but I'm still not buying in to
the idea that a task can be picked up and started immediately after a
delay of several months - but then that's just my observation and not
really relevant to your question.

With regard to the VBA approach. I would NOT used a lag. In my opinion
any lag of greater than 5 days is worthless. A much better approach is
to simply set a "start-no-earlier-than" constraint. I would still keep
the link to insure the logic is correct but only if the task indeed has
a predecessor that must be completed first. The following code will do
what you need, assuming there is no setup time for a delayed task.

Sub Schedule_Gapper()
Dim Cutoff As Date, Restart As Date
Dim t As Object
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
Cutoff = "5/30/" & Year(t.Start)
Restart = "9/1/" & Year(t.Start)
If t.Summary = False And t.Start < Restart Then
If Application.DateAdd(t.Start, t.Duration) > _
Cutoff Then t.Start = Restart
End If
End If
Next t
End Sub

If you want to learn more about Project VBA, go to our MVP website at:
http://www.mvps.org/project/links.htm
and look for the link at the bottom of the page, "Project 98 Visual
Basic Environment Training Materials". Even though it says it is for
Project 98, it is equally applicable to all current versions of Project.

Hope this helps.
John
Project MVP
>
>
>
> "John" wrote:
>
> > In article <A666EFE2-BF17-4BA9-864A-1267985B5977@xxxxxxxxxxxxx>,
> > "MSPuser" <MSPuser@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > Hi,
> > >
> > > I have a project that uses a ⤦Spring & Fall Onlyâ¤ù calendar with
> > > winter and
> > > summer designated as none-working time. The challenge is to keep tasks
> > > from
> > > being auto-scheduled to start in spring and finished in the fall.
> > >
> > > For example, a 5-day task with the predecessor which finishes on 05/29/06
> > > can be scheduled by MS Project from 05/30/2006 to 09/05/2006. This is not
> > > acceptable, as the task must be completed within 5 calendar days, i.e. it
> > > must be moved to 09/04/06 ⤳ 09/08/06.
> > >
> > > Putting constraints would not be a good solution as the schedule has
> > > hundreds of dependent tasks and it may require frequent adjustments back
> > > and
> > > forward in the future.
> > >
> > > Please suggest a way to auto-move the task forward to assure that it
> > > would
> > > be always completed within 5 days no matter when the predecessors
> > > finishes.
> > >
> > > Thank you in advance.
> >
> > MSPuser,
> > You have a very unique scheduling need. Project just isn't set up to
> > easily shift tasks as in your example but it is possible if a simple VBA
> > macro is used to automatically adjust the schedule. The macro could be
> > set up to run on user demand or it could be set up to run automatically
> > when the file is opened or closed.
> >
> > However just a comment. It appears to me that a simple shift of task
> > duration won't reflect reality. If there is that much delay between
> > working periods, I would think some "reorientation overhead" would be
> > needed. For example, let's say a task is 5 days duration and would
> > ordinarily start on May 28. Because of the end of May cutoff, the task
> > would need to be re-scheduled to the first of September. However, my
> > guess is that whoever is going to do the task will NOT be able to just
> > pick it up and start working on Sept. 1. Very likely there will be some
> > prep work before the task can actually be started. I could be wrong, but
> > there aren't too many things that can just be shelved for long periods
> > of time and then be instantly re-started.
> >
> > John
> > Project MVP
> >
.



Relevant Pages

  • Re: Spelling dictionaries grayed out
    ... That's very kind of you John, ... ' Fr Macro ... > the language for the whole document under most circumstances...) ... and never really thought about the possibility to do it through VBA. ...
    (microsoft.public.mac.office.word)
  • Re: Macro
    ... Then I have a macro that uses a VBA macro and oledb to read all summary data ... For VBA posts, ... I right now have a Master Consolidated file ... I appreciate your reply very much John, ...
    (microsoft.public.project)
  • Re: Custom fields in reports....
    ... Thanks John. ... I'm not the original poster, ... I am trying to save a macro creating a new report, ... VBA is an advanced feature of Office ...
    (microsoft.public.project)
  • Re: Early and Late S Curve.
    ... > Thanks John, ... > I wasn't going to write a piece of vba, as this only has to be performed ... > when we re-baseline a schedule. ... tend to be geared more toward power users and PM professionals. ...
    (microsoft.public.project)
  • Re: Breaking up Master Projects
    ... I VBA too, exactly what does your macro do? ... "John" wrote: ... >> Obviously with these number of lines, there are an inordinate amount of ...
    (microsoft.public.project)