Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim LigneFin As Integer
Dim NoLig As Single, NoCol As Single, NoCol1 As Single
If Not Intersect(Range("B1:AF2"), Target) Is Nothing Then
Target.Offset(0, 1).Select
End If
LigneFin = Sheets("Feuil2").Range("A60").End(xlUp).Row
If ActiveCell.Row < (LigneFin + 1) Then
If ActiveCell.Row > 2 Then
If (ActiveCell.Column > 1 And ActiveCell.Column < 33) Then
NoLig = ActiveCell.Row
NoCol = ActiveCell.Column
NoCol1 = NoCol + 40
If Cells(NoLig, NoCol1).Value = 1 Then
Cells(NoLig, NoCol1).Value = 0
Else
Cells(NoLig, NoCol1).Value = 1
End If
ActiveSheet.Unprotect
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End If
End If
End Sub