Application.DurationValue method (Project)

Returns the number of minutes in a duration.

Syntax

expression. DurationValue( _Duration_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Duration Required String The duration to be expressed in minutes.

Return value

Variant

Example

The following example adds the entered value to the duration of the selected task.

Sub DurationAdder() 
 
 Dim Temp As String 
 
 Temp = InputBox$("Enter amount by which to increase the duration:") 
 ActiveCell.Task.Duration = ActiveCell.Task.Duration + DurationValue(Temp) 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.