Office中国论坛/Access中国论坛
标题:
【Ysh自定义函数】获取批注中的内容
[打印本页]
作者:
盗梦
时间:
2015-1-23 14:36
标题:
【Ysh自定义函数】获取批注中的内容
本帖最后由 盗梦 于 2015-1-23 14:41 编辑
近来发现有些网友喜欢把内容放在批注。久而久之发现批注太多,处理很不方便,于是到处寻求把批注提取出来的办法。感觉这个需求弄成一个自定义函数挺实用的,如下图:
[attach]55512[/attach]
这个自定义函数代码比较简单
'函数名:获取批注的作者
'返回值:字符串(String)
'--参数:rng,单元格,必填
'--示例:=GetCommentAuthor(A1)
Public Function GetCommentAuthor(rng As Range) As String
If Not rng.Comment Is Nothing Then GetCommentAuthor = rng.Comment.Author
End Function
'函数名:获取批注的内容
'返回值:字符串(String)
'--参数:rng,单元格,必填
'--示例:=GetCommentText(A1)
Public Function GetCommentText(rng As Range) As String
If Not rng.Comment Is Nothing Then GetCommentText = rng.Comment.Text
End Function
复制代码
建议不要把数据放在批注,少用批注
[attach]55513[/attach]
作者:
xiaowuo2
时间:
2015-1-23 15:23
感谢分享,顶你
作者:
盗梦
时间:
2015-1-23 15:24
xiaowuo2 发表于 2015-1-23 15:23
感谢分享,顶你
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3