Share via


Application.DateAdd Method

Project Developer Reference

Adds a duration to a date to return a new date.

Syntax

expression.DateAdd(StartDate, Duration, Calendar)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
StartDate Required Variant The original date to which the duration is added.
Duration Required Variant The duration to add to the start date.
Calendar Optional Object A resource, task, or base calendar object. The default value is the calendar of the active project.

Return Value
Variant

Example
The following example displays the finish date of a three-day task that begins on 7/11/07 at 8 A.M.

Visual Basic for Applications
  Sub FindFinishDate()
    MsgBox Application.DateAdd(StartDate:="7/11/07 8:00 AM", Duration:="3d")
End Sub

See Also