Private Sub Worksheet_SelectionChange(ByVal Target As Range)
temp = Array("Oui", "Non")
If Not Application.Intersect(Target, Range("E12:E12")) Is Nothing Then
If Target.Count > 1 Then Exit Sub
With Target
p = Application.Match(Target, temp, 0)
If Not IsError(p) Then
If p = UBound(temp) + 1 Then p = 0
Else
p = 0
End If
Target = temp(p)
End With
End If
If Range("E12") = "Oui" Then
Range(Cells(14, 6), Cells(109, 12)).EntireColumn.Hidden = False
Else
Range(Cells(14, 6), Cells(109, 12)).EntireColumn.Hidden = True
End If
If Range("E12") = "Oui" Then
For i = 4 To 10 'pour i dont la valeur va de 4 à 10
Range("F:I" & i).Select
Selection.Cut
Range("B:E" & i).Select
ActiveSheet.Paste = False
Else
Range("F:I" & i).Select
Selection.Cut
Range("B:E" & i).Select
ActiveSheet.Paste = True
Next i 'incrémentation
Range("J:M" & i).Select
Selection.Cut
Range("M:P" & i).Select
ActiveSheet.Paste = False
Else
Range("J:M" & i).Select
Selection.Cut
Range("M:P" & i).Select
ActiveSheet.Paste = True
End If
End Sub