Help needed with duration - work days conversion to calendar days 
Author Message
 Help needed with duration - work days conversion to calendar days

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.



Wed, 03 Aug 2005 03:32:01 GMT  
 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.



Wed, 03 Aug 2005 04:33:42 GMT  
 Help needed with duration - work days conversion to calendar days

Runroader,
(At least that's what we call our AZ birds :-)
Try this macro. I think it will do exactly what you want.

Sub conv_wd_to_ed()
For Each t In ActiveProject.tasks
    If Not t Is Nothing And t.Summary = False Then
        newdur = VBA.DateDiff("d", t.Start, t.Finish)
        t.Duration = CStr(newdur) & "ed"
    End If
Next t
End Sub

John



Wed, 03 Aug 2005 15:17:11 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Total estimated project cost, project duration in working days/calendar days

2. Total project cost/Duration in calendar days

3. Update with Actual Work Cause Duration 0 Days?

4. Determining if given day is a non-work day

5. Need function for only working days

6. Import Excel file with varying day-to-day field names

7. Grid of days of week and time of day

8. how to write a day to day calculator????

9. Anyone knows how to convert a day function (11) to a stnadard day format (friday 11th)

10. May day, May day SOS Urgent

11. May day, May day SOS Urgent

12. VB4 Calander Grid Displays Days One day early

 

 
Powered by phpBB® Forum Software