Public Flag As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
' ci-dessous, 3 lignes ajoutées =======================================
If Not Intersect(Target, Range("D14:H500", "K14:O500")) Is Nothing Then
Sheets("Liste des surveillances 1").Range(Target.Address) = Target
End If
' =====================================================================
If Flag Then Exit Sub
If Not Application.Intersect(Target, Range("d14:d500")) Is Nothing Then
Flag = True
Target.Offset(0, 2).ClearContents
Flag = False
End If
'------------
If Not Application.Intersect(Target, Range("f14:f500")) Is Nothing Then
Flag = True
Target.Offset(0, -2).ClearContents
Flag = False
End If
If Flag Then Exit Sub
If Not Application.Intersect(Target, Range("f14:f500")) Is Nothing Then
Flag = True
Target.Offset(0, 2).ClearContents
Flag = False
End If
'------------
If Not Application.Intersect(Target, Range("h14:h500")) Is Nothing Then
Flag = True
Target.Offset(0, -2).ClearContents
Flag = False
End If
'**************************
If Flag Then Exit Sub
If Not Application.Intersect(Target, Range("k14:k500")) Is Nothing Then
Flag = True
Target.Offset(0, 2).ClearContents
Flag = False
End If
'------------
If Not Application.Intersect(Target, Range("m14:m500")) Is Nothing Then
Flag = True
Target.Offset(0, -2).ClearContents
Flag = False
End If
If Flag Then Exit Sub
If Not Application.Intersect(Target, Range("m14:m500")) Is Nothing Then
Flag = True
Target.Offset(0, 2).ClearContents
Flag = False
End If
'------------
If Not Application.Intersect(Target, Range("o14:o500")) Is Nothing Then
Flag = True
Target.Offset(0, -2).ClearContents
Flag = False
End If
End Sub