How to use custom Finish for dependency? RRS feed

  • Question

  • Hi,

    in my project hi have tasks with sub-tasks duration depends on the number of pieces.

    I have a custom number field for number of pieces and a custom duration field for the duration of the subtask for the single piece.

    I then created a custom duration field to calculate the duration of the total time required for the single subtask for the all samples.

    Then I created a custom Finish field that uses this formula to calculate when each subtask should finish is ProjDateAdd([Start],[Duration1],[Project Calendar])

    The problem I have is that the calendar uses default Duration and Finish to schedule the tasks so Finish is always different from Finish1.

    Is there a way to update the default Duration and Finish as function of custom duration and finish?


    Wednesday, March 11, 2015 11:18 PM

All replies

  • michele_1,

    Well, no and yes. On the "no" side, there is no way to have custom fields update the built-in fields directly. However, it could be done with some VBA. Actually you could also use paste links but that is highly NOT recommended because you would set yourself up for high probability of file corruption.

    So, if you are willing to use VBA then this simple macro will do it. Note, it assumes the Number1 field is the quantity and the Duration1 field is the time for a quantity of one.

    Sub SamplesXDur()
    Dim t As Task
    For Each t In ActiveProject.Tasks
        t.Duration = t.Number1 * t.Duration1
    Next t
    End Sub

    This is a sample file prior to running the macro.

    And this is what it looks like after the macro is run.

    But just on the side, why do you need a custom finish field, or even a second custom duration field? Given that you know the start date, all you need to set the Duration field, and hence the Finish field, is the result from the custom number field, which you state is the quantity of pieces, times the time (duration) for a single piece.

    Hope this helps.


    Thursday, March 12, 2015 2:17 AM