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
| Option Explicit
Sub es()
Dim Obj As OLEObject, V As New Collection, c As Range
Dim Level As Integer, i As Integer, j As Integer, z As Integer
Dim L As Single, T As Single, W As Single, H As Single
On Error Resume Next
Application.ScreenUpdating = False
For Each c In Range("d7", [d65000].End(xlUp))
If c <> "" Then V.Add c.Value, CStr([c])
Next c
i = 7
For Level = V.Count To 1 Step -1
j = i + 4
Cells(i, 2) = Level
L = Cells(i, 5).Left
T = Cells(i, 5).Top
W = Cells(i, 5).Width
H = Cells(i, 5).Height
Set Obj = Sheets(1).OLEObjects.Add("Forms.Checkbox.1", _
Left:=L, Top:=T, Height:=H + 5, Width:=W + 5)
Obj.Name = "Level" & i
i = i + 1
Next Level
Application.ScreenUpdating = True
End Sub |
Partager