1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Sub AjouteCheckBox()
Dim Box As CheckBox
Dim Cpt As Integer, LigDeb As Integer, LigFin As Integer, LigLiee As Integer
Dim ColonneBox As String, ColLiee As String, ColDeb As String, ColFin As String
LigDeb = 13
LigFin = 29
ColDeb = 4
ColFin = 10
ColLiee = "L"
Application.ScreenUpdating = False
With ActiveSheet
For Col = ColDeb To ColFin
For Cpt = LigDeb To LigFin
If .Rows(Cpt).RowHeight < 13.5 Then
.Rows(Cpt).RowHeight = 13.5
End If
Set Box = .CheckBoxes.Add((.Cells(Cpt, Col).Left + (.Cells(Cpt, Col).Width) / 2) - 8.25, .Cells(Cpt, Col).Top - 1, 0, 0)
With Box
.Name = "CheckBoxCol" & Col & "Lig" & Format(Cpt, "000")
.Height = 16.5
.Width = 16.5
.Characters.Text = ""
.LinkedCell = ColLiee & Cpt
End With
Cpt = Cpt + 3
Next Cpt
Next Col
End With
Application.ScreenUpdating = True
End Sub |
Partager