您现在的位置是:首页 > Excel技巧>【Ysh自定义函数】获取批注中的内容

怎么显示批注内容-【Ysh自定义函数】获取批注中的内容

发布于2022-04-150人已围观

近来发现有些网友喜欢把内容放在批注。久而久之发现批注太多,处理很不方便,于是到处寻求把批注提取出来的办法。感觉这个需求弄成一个自定义函数挺实用的,如下图:
怎么显示批注内容


这个自定义函数代码比较简单

'函数名:获取批注的作者
'返回值:字符串(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

建议不要把数据放在批注,少用批注



标签

相关文章

文章评论

表情

共0条评论
  • 这篇文章还没有收到评论,赶紧来抢沙发吧~

标签云

站长特荐