Iâ??m working on a project which handles a multitude (about 200) of short tasks
(fixed duration) with an 8 h/day working calendar (8 a.m. to 5 p.m.)
I can resume my problem like this:
if a task can not be started and ended on the same day, it has to be delayed
to the next day.
Example:
Task A = 5 h (fixed duration)
Task B = 4 h (fixed duration)
Task B can not start on the same day of Task A because there is only 8 hours
working time. Task B will therefore start next day at 8 a.m.

Can somebody tell me how I can set a delay for Task B which is the result of
(working time) â?? (Task A duration)
only in the case that
(finish day of Task B) not equal (start day of Task B) ?

Thanks

Re: Variable Delay by John

John
Thu Feb 16 14:58:01 CST 2006

In article <DFAB1153-5C86-4008-B825-D411EE27E863@microsoft.com>,
"norry" <norry@discussions.microsoft.com> wrote:

> Iâ??m working on a project which handles a multitude (about 200) of short tasks
> (fixed duration) with an 8 h/day working calendar (8 a.m. to 5 p.m.)
> I can resume my problem like this:
> if a task can not be started and ended on the same day, it has to be delayed
> to the next day.
> Example:
> Task A = 5 h (fixed duration)
> Task B = 4 h (fixed duration)
> Task B can not start on the same day of Task A because there is only 8 hours
> working time. Task B will therefore start next day at 8 a.m.
>
> Can somebody tell me how I can set a delay for Task B which is the result of
> (working time) â?? (Task A duration)
> only in the case that
> (finish day of Task B) not equal (start day of Task B) ?
>
> Thanks

norry,
This or a very similar question has been posted previously. The most
effective way to accomplish this is with a simple VBA macro. It's been a
while since I wrote this code and I had to tweak it slightly for what
you want but it should work. (Note, I did not test this version).

'This macro ensures all tasks start and finish the same day. Note: it
'does leave a start-no-earlier-than constraint on all shifted tasks.
'written by John 10/27/04 10:00 am
Sub NextDayA()
For Each t In activeproject.Tasks
If Not t Is Nothing Then
If t.Summary = False Then
If Weekday(t.Start) <> Weekday(t.Finish) Then
NxtDayStrt = Application.DateAdd(t.Start, "1d")
t.Start = CDate(Mid(NxtDayStrt, 1, _
InStr(1, NxtDayStrt, " ")) & "8:00:00 am")
End If
End If
End If
Next t
End Sub

Hope this helps.
John
Project MVP