Function DateRecente(x As String)
Dim AA$, t, d, y As Date, max
Dim an&, mois&, jour&
DateRecente = "": AA = Left(Year(Date), 2)
t = Split(Replace(Replace(x, Chr(10), " "), Chr(13), " "))
If LBound(t) < 0 Then Exit Function
For Each d In t
y = 0
If d Like "#?#?##" And Mid(d, 2, 1) = Mid(d, 4, 1) And Mid(d, 2, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = AA & Right(d, 2): mois = Mid(d, 3, 1): jour = Left(d, 1)
ElseIf d Like "##?#?##" And Mid(d, 3, 1) = Mid(d, 5, 1) And Mid(d, 3#, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = AA & Right(d, 2): mois = Mid(d, 4, 1): jour = Left(d, 2)
ElseIf d Like "#?##?##" And Mid(d, 2, 1) = Mid(d, 5, 1) And Mid(d, 2, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = AA & Right(d, 2): mois = Mid(d, 3, 2): jour = Left(d, 1)
ElseIf d Like "##?##?##" And Mid(d, 3, 1) = Mid(d, 6, 1) And Mid(d, 3, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = AA & Right(d, 2): mois = Mid(d, 4, 2): jour = Left(d, 2)
ElseIf d Like "#?#?####" And Mid(d, 2, 1) = Mid(d, 4, 1) And Mid(d, 2, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = Right(d, 4): mois = Mid(d, 3, 1): jour = Left(d, 1)
ElseIf d Like "##?#?####" And Mid(d, 3, 1) = Mid(d, 5, 1) And Mid(d, 3#, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = Right(d, 4): mois = Mid(d, 4, 1): jour = Left(d, 2)
ElseIf d Like "#?##?####" And Mid(d, 2, 1) = Mid(d, 5, 1) And Mid(d, 2, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = Right(d, 4): mois = Mid(d, 3, 2): jour = Left(d, 1)
ElseIf d Like "##?##?####" And Mid(d, 3, 1) = Mid(d, 6, 1) And Mid(d, 3, 1) <> ":" And Mid(d, 2, 1) <> " " Then
an = Right(d, 4): mois = Mid(d, 4, 2): jour = Left(d, 2)
End If
y = DateSerial(an, mois, jour)
If Year(y) = an And Month(y) = mois And Day(y) = jour Then If y > 1 Then If y > max Then max = y
Next d
If max > 0 Then DateRecente = max Else DateRecente = ""
End Function