- 打开Excel文件;
- 找到开发工具 -> Visual Basic 打开VBA窗口;
- 没有开发工具请在 文件 -> 选项 中把 开发工具 打 V 即可;
- 输入以下代码,按F5,运行一次,然后关闭保存即可。
Sub Shapes1() 'Delete all Objects except Comments On Error Resume Next ActiveSheet.DrawingObjects.Visible = True ActiveSheet.DrawingObjects.Delete On Error GoTo 0 End Sub
删除所有文本框 对象:
Sub deletealltextboxes() ActiveSheet.TextBoxes.Delete End Sub
删除所有相片对象:
Sub deleteallpics() Dim pic As Object For Each pic In ActiveSheet.Pictures pic.Delete Next pic
Sub Shapes1() 'Delete all Objects except Comments On Error Resume Next ActiveSheet.DrawingObjects.Visible = True ActiveSheet.DrawingObjects.Delete On Error GoTo 0 End Sub