vba add month to date code example
Example: vba add month to date
MsgBox DateAdd("m", 1, "1995-01-31") ' 1995-02-28
MsgBox DateAdd("m", -2, "1995-01-31") ' 1994-11-30
MsgBox DateAdd("yyyy", 2, "1995-01-31") ' 1997-01-31
MsgBox DateAdd("m", 1, "1995-01-31") ' 1995-02-28
MsgBox DateAdd("m", -2, "1995-01-31") ' 1994-11-30
MsgBox DateAdd("yyyy", 2, "1995-01-31") ' 1997-01-31