Function Dates Times Class

AddMonths

Add a number of months to the given date.

Signature (Visual Basic / VBA)

Public Function AddMonths( _
      ByVal vDate As Variant _
    , ByVal vMonths As Variant _
    ) As Variant

Code Example

    AddMonths(#1/15/99#,  1) = #2/15/99#
    AddMonths(#1/31/99#,  1) = #2/28/99#
    AddMonths(#4/30/99#,  1) = #5/30/99#
    AddMonths(#4/30/99#, -2) = #2/28/99#

Parameters

Parameter Description
vDate The date to which a number of months are added according to vMonths. Function returns Null if vDate is Null or cannot be interpreted as a Date.
vMonths The number of months to add to the date vDate. vMonths is truncated to a long integer number. Function returns Null if vMonths is Null or cannot be interpreted as a Long Integer number.

Notes & Version History

Note This function returns the exact same results as the EDATE function in Microsoft Excel.
v2.0 Addition This function is new to this version of Entisoft Tools.