excel中VBA删除工作簿中的所有批注
时间:2023-04-10 15:42:07
用下面的VBA代码可以同时删除工作簿中所有工作表中的批注:
1.按Alt+F11,打开VBA编辑器。
2.在代码窗口中输入下列代码
Sub RemoveAllComments()
Dim sht As Worksheet
Dim cmt As Comment
For Each sht In ActiveWorkbook.Worksheets
For Each cmt In sht.Comments
cmt.Delete
Next
Next
End Sub
3.关闭VBA编辑器,按快捷键Alt+F8,打开“宏”对话框,选择包含“RemoveAllComments”的宏名,并单击“执行”按钮。
标签:excel,中,VBA,删除,工作簿,中的,所有,批注,用下
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
用Word2007制作公司组织结构图的方法
2023-12-02 06:36:28
![](https://img.aspxhome.com/file/2023/5/19385_0s.jpg)
win10怎么还原语言栏位置?win10还原语言栏位置教程
2023-11-12 11:04:53
![](https://img.aspxhome.com/file/2023/2/48522_0s.png)
格式刷的高级用法,原来还可以这么用!
2023-07-12 12:46:37
![](https://img.aspxhome.com/file/2023/7/39257_0s.gif)
iOS 14.2 正式版更新修复内容汇总
2023-10-26 05:02:14
![](https://img.aspxhome.com/file/2023/5/a194365_0s.png)
Excel中建立华丽分割线的操作技巧
2023-09-21 20:41:54
word实战技巧:在word中插入图片
2022-05-26 00:41:18
iOS15.4值得升级吗?各机型升级iOS15.4续航实测
2023-08-18 13:35:50
![](https://img.aspxhome.com/file/2023/2/45562_0s.png)
Word2016首字母下沉怎么操作?Word2016首字母下沉操作教学
2023-02-16 04:12:21
![](https://img.aspxhome.com/file/2023/1/31161_0s.png)
Word2003自动编号的方法步骤图
2022-12-10 20:31:47
如何编辑pdf文件
2023-07-28 08:32:59
![](https://img.aspxhome.com/file/2023/6/15286_0s.jpg)
Acrobat怎么删除pdf文件中的水印?
2023-06-14 15:44:38
![](https://img.aspxhome.com/file/2023/5/15155_0s.png)
在word文档中怎么做台签呢?
2023-11-17 11:41:23
![](https://img.aspxhome.com/file/2023/9/24959_0s.jpg)
office2013怎么不用密匙激活码长期使用?
2023-08-03 23:01:16
![](https://img.aspxhome.com/file/2023/2/15582_0s.jpg)
Win10安装软件时出现乱码怎么办?
2023-11-14 17:18:45
![](https://img.aspxhome.com/file/2023/2/49152_0s.jpg)
在excel表格中如何填充颜色?
2022-06-06 08:56:09
excel尚未安装打印机怎么实现打印预览?
2023-04-29 17:17:01
![](https://img.aspxhome.com/file/2023/0/42710_0s.jpg)
如何将excel数据行列转置的教程
2022-08-11 18:01:32
excel表格打开很卡该怎么解决?
2022-06-04 08:02:49
![](https://img.aspxhome.com/file/2023/8/37418_0s.jpg)
word如何设置显示修订痕迹
2022-01-22 05:47:08
word怎么创建表格?word制作表格的步骤教程
2023-10-18 20:20:25
![](https://img.aspxhome.com/file/2023/8/31198_0s.gif)