Function contrôle_la_date(d As String)
[COLOR="SeaGreen"][B]'d est supposée être au format j/m ou j/m/a.[/B][/COLOR]
Dim i As Byte, x, y
x = Split(Replace(Replace(Replace(d, "-", "/"), ".", "/"), ",", "/") & "/" & Year(Now()), "/")
contrôle_la_date = DateSerial(x(2), x(1), x(0))
y = Split(contrôle_la_date, "/")
For i = 0 To 2
If CInt(y(i)) <> CInt(x(i)) Then Exit For
Next i
If i < 3 Then contrôle_la_date = "date invalide"
End Function