|
- Sub VBA_4()
- Dim obj As Object, shp As Shape
- Dim s(1 To 8) As Variant, b As String, h As Long, i As Long
- Application.ScreenUpdating = False
- On Error Resume Next
- With ActiveSheet
- For Each shp In .Shapes
- If shp.Name Like "Group*" Then
- shp.Left = [f6].Left
- shp.Top = [f6].Top
- .Shapes(shp.Name).Ungroup
- End If
- Next
- b = "CheckBox"
- h = .OLEObjects(b & 1).Height
- For i = 1 To 16
- Cells(i, "IV") = Not (Cells(i, "IV"))
- With .OLEObjects(b & i)
- .Object.Caption = b & i
- .LinkedCell = "IV" & i
- If i < 9 Then
- .Left = [c6].Left
- .Top = [c6].Top + (i - 1) * h
- Else
- s(i - 8) = b & i
- End If
- If i Mod 3 = 1 Then
- .Object.ForeColor = RGB(255, 0, 0)
- ElseIf i Mod 3 = 2 Then
- .Object.ForeColor = RGB(0, 0, 255)
- Else
- .Object.ForeColor = RGB(0, 255, 255)
- End If
- End With
- Next
- .Shapes.Range(s).Group
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|