- 帖子
- 75
- 主題
- 19
- 精華
- 0
- 積分
- 135
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- 2007 010
- 閱讀權限
- 20
- 註冊時間
- 2010-5-18
- 最後登錄
- 2013-10-26
|
批量加入及删除复选框
Sub 批量加入复选框()
Application.ScreenUpdating = False
Dim rng As Range
For Each rng In Selection
With rng
With Sheet1.CheckBoxes.Add(.Left, .Top, .Width, .Height) '.Select
.Value = xlOff
.LinkedCell = rng.Offset(0, 1).Address
End With
End With
Next
Application.ScreenUpdating = True
End Sub
Sub 批量删除复选框()
Dim obj As Shape
For Each obj In Sheet1.Shapes
If obj.Name Like "Check*" Then obj.Delete
Next
End Sub
Sub 批量修改连接单元格()
Application.ScreenUpdating = False
Dim obj As Shape
For Each obj In Sheet1.Shapes
If obj.Name Like "Check*" Then
obj.Select
With Selection
.Value = xlOff
.LinkedCell = Range(obj.TopLeftCell.Address).Offset(0, 1).Address
End With
End If
Next
Application.ScreenUpdating = True
End Sub |
|