- ·上一篇教育:excel表格excel利用VBA统计选定的单元格数量
- ·下一篇教育:excel表格excel将工作表按笔画或拼音顺序排序
excel表格excel用自定义函数获取单元格注释
我们可以用一个自定义函数来提取单元格注释。方法如下:
1.按Alt+F11,打开VBA编辑器。
2.单击菜单“插入→模块”,在右边的代码窗口中输入代码:
Function GetCommentText(rCommentCell As Range)
Dim strGotIt As String
On Error Resume Next
strGotIt = WorksheetFunction.Clean(rCommentCellment.Text)
GetCommentText = strGotIt
On Error GoTo 0
End Function
3.关闭VBA编辑器。在单元格中输入公式:
=GetCommentText(B4)
将在当前单元格中返回B4单元格中的注释。
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)