在excel用VBA更改批注的作者
时间:2022-05-14 14:44:59
在Excel中,当光标移动到包含批注的单元格中时,通常会在状态栏和批注中显示批注者的名称。如果需要将批注者改为其他人,可以用下面的VBA代码。以后再插入新的批注,也将使用新输入的名称。使用前先将代码中的“新作者”和“原作者”按照需要进行替换。
Sub ChangeCommentName()
Dim ws As Worksheet
Dim cmt As Comment
Dim strOld As String
Dim strNew As String
Dim strComment As String
strNew = "新作者"
strOld = "原作者"
Application.UserName = strNew
For Each ws In ActiveWorkbook.Worksheets
For Each cmt In ws.Comments
strComment = Replace(cmt.Text, strOld, strNew)
cmt.Delete
cmt.Parent.AddComment Text:=strComment
Next cmt
Next ws
End Sub
标签:作者,原作者,名称,批注,Excel函数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
word怎么对文档中的文字进行全选?
2023-03-03 10:05:03
![](https://img.aspxhome.com/file/2023/7/24467_0s.jpg)
Excel的Hyperlink函数 在Excel中快速创建文件的超级链接
2023-08-16 10:13:15
![](https://img.aspxhome.com/file/2023/8/a155588_0s.jpg)
Win10提示“该文件没有与之关联的程序来执行该操作”怎么解决?
2023-11-10 22:19:44
![](https://img.aspxhome.com/file/2023/2/48692_0s.jpg)
如何删除Word 里最近使用过的文档
2023-01-04 22:21:50
![](https://img.aspxhome.com/file/2023/7/34927_0s.jpg)
excel怎么制作工资条
2022-09-15 15:17:06
![](https://img.aspxhome.com/file/2023/1/55131_0s.gif)
Word动画教程:Word2003中公式编辑器的使用方法
2023-10-13 09:22:45
![](https://img.aspxhome.com/file/2023/4/29204_0s.gif)
苹果30W快充好用吗?30W快充多久能充满?
2023-07-26 23:03:09
![](https://img.aspxhome.com/file/2023/8/45258_0s.jpg)
Word在多图长文档中如何让图片编号自动更新
2023-10-28 12:57:38
![](https://img.aspxhome.com/file/2023/9/29589_0s.jpg)
win10杜比音效值得买吗?win10杜比音效是否值得入手
2023-11-01 19:30:32
![](https://img.aspxhome.com/file/2023/6/47666_0s.png)
在word中画横线的几种简单方法介绍
2023-06-03 14:47:04
![](https://img.aspxhome.com/file/2023/1/27111_0s.jpg)
iOS16 beta7值得升级吗?iOS16 beta7升级反馈汇总
2023-08-14 23:22:23
![](https://img.aspxhome.com/file/2023/1/45211_0s.png)
Excel中进行表格斜线画图的操作方法
2023-04-03 13:58:48
Win10更新后打印机蓝屏APC_INDEX_MISMATCH怎么办?
2023-12-13 21:25:33
![](https://img.aspxhome.com/file/2023/3/51883_0s.png)
如何批量给word文档的图片插入编号,并且增加、删除图片不影响编号的连续性
2023-11-30 07:39:37
![](https://img.aspxhome.com/file/2023/5/32515_0s.jpg)
用Word怎么制作三线表?
2022-07-26 20:09:15
![](https://img.aspxhome.com/file/2023/3/25403_0s.jpg)
Office2019预览版特色功能分享
2023-09-14 09:09:30
![](https://img.aspxhome.com/file/2023/9/16039_0s.png)
win10老是蓝屏重启的解决方法
2023-11-24 05:02:37
![](https://img.aspxhome.com/file/2023/7/50897_0s.png)
如何在word文档中对图片进行裁剪的方法
2022-12-01 01:36:32
![](https://img.aspxhome.com/file/2023/2/33162_0s.jpg)
在excel表格中怎么水平垂直居中对齐?
2023-05-06 14:52:00
![](https://img.aspxhome.com/file/2023/4/40964_0s.jpg)
excel大事记图表怎么做?
2022-10-14 11:42:19
![](https://img.aspxhome.com/file/2023/7/41937_0s.jpg)