1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
   |  ActiveSheet.CheckBoxes.Add(Left:=GaucheBouton, Top:=SommetBouton, Width:=LargeurBouton, Height:=HauteurBouton).Select
    Selection.Characters.Text = ""
    Selection.Name = couleur & op
 
    With ActiveWorkbook.VBProject.VBComponents("Module2").CodeModule
    X = .CountOfLines
    .InsertLines X + 1, "Sub Mac" & ActiveSheet.Name() & op & couleur & " ()"
    .InsertLines X + 2, "If " & couleur & op & ".value = True Then"
    .InsertLines X + 3, "Sheets(2).Cells(" & ActiveSheet.Name + 2 & "," & op + 2 & ").Interior.Color = " & col
    .InsertLines X + 4, "Else Sheets(2).Cells(" & ActiveSheet.Name + 2 & "," & op + 2 & ").Interior.TintAndShade = 0"
    .InsertLines X + 5, "End If"
    .InsertLines X + 6, "End Sub"
 
    Selection.OnAction = "Mac" & ActiveSheet.Name() & op & couleur
    End With
 
End Sub | 
Partager