
Help needed with duration - work days conversion to calendar days
If you schedule using edays (elapsed days) then duration will be calculated
based on the number of calendar days. Simply changing the duration to edays
will probably disrupt your start and finish dates however. To really do this
accurately you would probably have to write some
Visual Basic code which
would do the correct sort of date math and then would change the task
duration.
All of this is also likely to{*filter*}up any work which has been entered for
the tasks.
If you just need a column to show the duration in calendar days (a read only
column) then I'd suggest that you write a small macro which would calculate
the duration and put the data into one of the text fields.
Something like:
Sub CalendarDuration()
Dim t As Task
Dim d As Long
'loop through all tasks
For Each t In ActiveProject.Tasks
'check for blank lines
If Not t Is Nothing Then
'subtract start from finish using minutes as units
d = DateDiff("n", t.Start, t.Finish)
'if the modulus of the difference is not a full day
If (d + 1) Mod 1440 <> 0 Then
'add a day
d = d + 1440
End If
'set text10 for the task to the difference rounded down to the nearest
whole number
t.Text10 = d \ 1440 & " Days"
End If
Next t
End Sub
--
Please try to keep replies in this group. I do check e-mail, but only
infrequently.
For Macros and other things check http://www.*-*-*.com/
-Jack Dahlgren, Project MVP
+++++++++++++++++++
Quote:
> I'm running 98 and the schedule is reading duration in work days. I
> need to change this to calendar days and have the start and stop day
> remain unchanged and the duration updated for calendar days. Does
> anyone know how to do this?
> Thanks.