遍历所有控件,逐个删除就可以了。
举例说明:
例如有表格如图:
第一步:插入模块,编写代码如下:
Sub test()
Sheets("sheet1").Activate
For Each myc In ActiveSheet.Shapes
myc.Delete
Next myc
End Sub
第二步:运行宏test。如图:
结果如图:
打开控件工作箱,在设计模式下, 按CTRL+G, 定位条件, 对象, 删除
Sub 删除插件()
For Each ws In Worksheets
On Error Resume Next
ws.Activate
For Each i In ws.Shapes
i.Delete
Next i
Next ws
msgbox"操作完毕"
End Sub
Dim myShape As shape
for each myShape in me.shapes
myshape.delete
next