Function test() As String
Dim j As Integer, m As Integer, a As Integer
Dim toto As Date
j = 12
m = 6
a = 2002
toto = CDate(j & "/" & m & "/" & a)
Debug.Print toto
' ajoute 3 mois à toto
toto = DateAdd("M", 3, toto)
Debug.Print toto
' enlève 6 jours à toto
toto = DateAdd("d", -6, toto)
Debug.Print toto
End Function
|