Share via


ActualDuration Property

Returns or sets the actual duration (in minutes) of a task. Read-only for summary tasks. Read/write Variant.

Example

The following example marks the tasks in the active project with actual durations that exceed a certain number of minutes.

Sub MarkLongDurationTasks()

    Dim T As Task           ' Task object used in For Each loop
    Dim Minutes As Long     ' Duration entered by user

    ' Prompt user for the actual duration, in minutes.
    Minutes = Val(InputBox$("Enter the actual duration, in minutes: "))

    ' Don't do anything if the InputBox$ was cancelled.
    If Minutes = 0 Then Exit Sub

    ' Cycle through the tasks of the active project.
    For Each T In ActiveProject.Tasks
        ' Mark a task if it exceeds the duration.
        If T.ActualDuration > Minutes Then T.Marked = True
    Next T

End Sub

Applies to | Task Object, Tasks Collection Object

See Also | ActualCost Property | ActualFinish Property | ActualStart Property | ActualWork Property | BaselinenDuration Property | DurationFormat Method | Durationn Property | DurationValue Method | DurationVariance Property | RemainingDuration Property