Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 And Target.Cells.Count = 1 Then
Dim age As Long, a, m, j
age = Now - Target.Value
a = Int(age / 365.25)
m = Int((age / (365.25 / 12)) Mod 12)
'j=int(age mod(365.25/12))
' === !!!!! Mod VBA arrondi les nombres à virgules flottantes à des nombres entiers
j = Int(age - (365.25 / 12) * Int(age / (365.25 / 12)))
On Error Resume Next
Target.AddComment
Target.Comment.Text Text:= _
IIf(a > 0, a & IIf(a > 1, " ans ", " an "), "") _
& IIf(m > 0, m & " mois ", "") _
& IIf(j > 0, j & IIf(j > 1, " jrs", " jr"), "")
End If
End Sub