Private Sub Worksheet_Calculate() 'à chaque fois que la feuille est recalculée, les Cases à cocher sont Mise à jour
Application.ScreenUpdating = False
Application.EnableEvents = False
Call PutCaseACocher(ActiveSheet.Name, "G") 'met une case en G si E contient une ville
Call PutCaseACocher(ActiveSheet.Name, "M") 'met une case en AE si AG=1
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'si on clique sur une case en AG ou G, on bascule entre cochée et décochée
Application.EnableEvents = False
If Target.Count = 1 Then
If ((Not Intersect(Target, Range("M:M")) Is Nothing) Or (Not Intersect(Target, Range("G:G")) Is Nothing)) And Target <> "" Then
Target = IIf(Target = "x", "o", "x")
Target.Offset(0, -1).Select
End If
End If
Application.EnableEvents = True
End Sub