Private Const CelluleDate = "K74"
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range(CelluleDate)) Is Nothing Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
'Pour éviter le dépassement de capacité sur un format Date
Target.NumberFormat = "General"
If IsDate(Target.Value) Then Exit Sub
If IsNumeric(Target.Value) Then
Application.EnableEvents = False
On Error Resume Next
If Target.Value < 1000000 Then
'152022 -> 01/05/2022
Target.Value = DateSerial(Target.Value Mod 10000, (Target.Value \ 10000) Mod 10, Target.Value \ 100000)
ElseIf Target.Value >= 1011900 Then
'1052022 ->...