Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Sortie
Application.EnableEvents = False
If Not Intersect(Target, Columns(1)) Is Nothing Then
If IsNumeric(Target) Then
If Len(Target) = 5 Then
Target = CDate(Left(Target, 1) & "/" & Mid(Target, 2, 2) & "/" & Right(Target, 2))
ElseIf Len(Target) = 6 Then
Target = CDate(Left(Target, 2) & "/" & Mid(Target, 3, 2) & "/" & Right(Target, 2))
End If
Target.NumberFormat = "dd/mm/yy"
End If
End If
Sortie:
Application.EnableEvents = True
End Sub