|
すいません。コピペする際にちょっとおかしくなったので、再掲します。
Sub MyCheckBox_Add()
Dim xR As Long, xC As Long
Dim MyR As Range, C As Range
With ActiveSheet
If .FilterMode = False Then Exit Sub
.CheckBoxes.Delete
With .AutoFilter.Range
xR = .Rows.Count - 1: xC = .Columns.Count
Set MyR = .Range("A2").Resize(xR) _
.Offset(, xC).SpecialCells(12)
End With
For Each C In MyR
.CheckBoxes.Add(C.Left + 0.1, C.Top + 0.1, _
C.Width - 0.1, C.Height - 0.1).Caption = ""
Next
.CheckBoxes.OnAction = "Test_Action"
End With
Set MyR = Nothing
End Sub
|
|