Bonjour,
Option Explicit
Public Function AGE(Date1 As Date, Date2 As Date) As String
Dim D1 As Long, D2 As Long
Dim Elt As Long
Dim x As String, y As String, z As String
D1 = Int(Date1): D2 = Int(Date2)
If D2 < D1 Then
AGE = "Date invalide"
Exit Function
End If
Elt = Evaluate("DATEDIF(" & D1 & "," & D2 & ",""y""")
If Elt > 0 Then x = Elt & IIf(Elt > 1, " ans, ", " an, ")
Elt = Evaluate("DATEDIF(" & D1 & "," & D2 & ",""ym""")
If Elt > 0 Then y = Elt & " mois, "
Elt = Evaluate("DATEDIF(" & D1 & "," & D2 & ",""md""")
If Elt > 0 Then z = Elt & IIf(Elt > 1, " jours", " jour")
AGE = x + y + z
If Right(AGE, 2) = ", " Then AGE = Left(AGE, Len(AGE) - 2)
End Function