|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 复选框()
ReDim arr(1 To ActiveSheet.CheckBoxes.Count, 1 To 12)
For Each ob In ActiveSheet.CheckBoxes
mm = ob.Value
mc = ob.Caption
If ob.Value = 1 Then
If ob.TopLeftCell.Column = 6 Then
r = ob.TopLeftCell.Row
n = n + 1
arr(n, 1) = Cells(r, 2)
arr(n, 4) = Cells(r, 3)
arr(n, 8) = Cells(r, 4)
arr(n, 12) = Cells(r, 7)
End If
End If
Next ob
If n <> "" Then
With Sheets("委托书")
r = .Cells(Rows.Count, 8).End(xlUp).Row
If r > 10 Then .Range("h11:v" & r) = Empty
.[h11].Resize(n, 12) = arr
End With
End If
End Sub
Sub 指定宏()
With ActiveSheet
For Each ob In .CheckBoxes
If ob.TopLeftCell.Column = 6 Then
ob.Select
Selection.OnAction = "复选框"
End If
Next ob
End With
MsgBox "ok!"
End Sub
|
|