DateAdd Function
Private Sub CommandButton1_Click()
MsgBox DateAdd("yyyy", 2, "1-jan-2016")
Range("A1").Value = DateAdd("yyyy", 2, "1-oct-2016")
Range("A2").Value = DateAdd("yyyy", -2, "1-oct-2016")
Range("A3").Value = DateAdd("ww", -2, "1-oct-2016")
Range("A4").Value = DateAdd("w", -2, "1-oct-2016")
Range("A5").Value = DateAdd("d", -2, "1-oct-2016")
Range("A6").Value = DateAdd("m", 45, "1-oct-2016")
Range("A7").Value = DateAdd("h", 3, "1-oct-2016")
End Sub
DateAdd Function - Serial Dates
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 100
Cells(i, 1).Value = DateAdd("d", i, "1-1-2016")
Next
End Sub