excel如何利用自定义函数提取单元格中的批注
时间:2023-03-22 08:20:18
用下面的自定义函数可以将某个单元格中的批注提取到其他单元格中,方法如下:
1.按Alt+F11打开VBA编辑器,单击菜单“插入→模块”,在“工程”窗口中会看到Excel插入了一个名称为“模块1”的模块。
2.在右侧“模块1”的代码窗口中输入下列代码:
Function GetComment(rCell As Range)
Application.Volatile '将自定义函数标记为易失性函数
Dim Cmt As String
On Error Resume Next
Cmt = rCell.Comment.Text
GetComment = Right(Cmt, Len(Cmt) - InStr(1, Cmt, ":", vbTextCompare))
On Error GoTo 0
End Function
3.关闭VBA编辑器,返回到Excel界面。假如要提取A10单元格中的批注,则在其他单元格中输入公式:
=GetComment(A10)
回车后即可得到A10单元格中的批注内容,注意本自定义函数仅提取批注内容,而不包含批注作者。由于将自定义函数标记为易失性函数,如果A10单元格中的批注被修改,按F9键或当任意单元格进行计算时即可得到修改后的批注内容。
标签:excel,如何,利用,自定义,函数,提取,单元格
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
EDIUS如何制作倒放视频?EDIUS制作倒放视频的方法步骤
2023-01-13 06:47:59
![](https://img.aspxhome.com/file/2023/8/a333089_0s.jpg)
Word文档技巧—文档中图片批量居中显示
2022-04-26 00:06:08
系统之家U盘重装Win7的图文教程
2022-08-11 08:21:15
![](https://img.aspxhome.com/file/2023/1/a280307_0s.png)
w10开机屏幕就剩鼠标箭头_图文详解win10开机黑屏只有鼠标解决方法
2023-06-03 14:17:44
![](https://img.aspxhome.com/file/2023/4/a303691_0s.jpg)
微软推出Windows物联网操作系统预览版
2023-07-22 10:13:21
![](https://img.aspxhome.com/file/2023/29/a253966_0s.jpg)
Win7如何删除休眠文件?Win7删除休眠文件的方法
2022-04-20 22:51:41
![](https://img.aspxhome.com/file/2023/26/a228327_0s.jpg)
Win10 20H2系统睡眠模式变自动关机怎么回事?
2023-12-02 03:49:10
![](https://img.aspxhome.com/file/2023/26/a223690_0s.jpg)
U盘格式化四种常见问题解决汇总
2023-04-12 16:53:45
![](https://img.aspxhome.com/file/2023/3/a297478_0s.jpg)
分享六个常用的Excel小技巧
2022-08-18 10:54:58
Win10 20H1快速预览版18875怎么手动更新升级?
2023-05-26 06:08:06
![](https://img.aspxhome.com/file/2023/28/a241312_0s.jpg )
在Word文档中如何输入印章?Word输入盖章符号
2022-04-04 17:38:07
![](https://img.aspxhome.com/file/2023/4/24314_0s.jpg)
excel 如何设置打印表格标题 excel设置打印表格标题图解教程
2022-06-11 02:25:35
![](https://img.aspxhome.com/file/2023/9/a155529_0s.jpg)
excel表格“追踪错误”这项功能千万不要错过
2022-09-16 00:31:36
![](https://img.aspxhome.com/file/2023/9/a142209_0s.png)
Win7安装CAD软件安装不上每次安装都提示错误1327
2022-06-24 00:34:30
![](https://img.aspxhome.com/file/2023/28/a249721_0s.jpg)
Win11怎么开启剪贴板自动复制?Win11开启剪贴板自动复制的方法
2022-10-14 06:13:00
![](https://img.aspxhome.com/file/2023/28/a239268_0s.jpg)
Photoshop2021高效功能增,快来感受一下!
2022-07-19 01:52:48
![](https://img.aspxhome.com/file/2023/8/a208358_0s.jpeg)
PS怎么做出立体分割图片效果?PS做出立体分割图片效果的方法
2023-02-20 06:56:27
![](https://img.aspxhome.com/file/2023/8/a333691_0s.jpg)
电脑截图怎么把鼠标截进去?电脑截图怎样把鼠标也截下来?
2022-11-05 08:27:44
![](https://img.aspxhome.com/file/2023/6/a323706_0s.png)
wps表格有哪些度量单位
2023-01-08 04:06:31
如图 点击插入函数
2023-01-31 18:23:21