excel-formula - Excel IF函数基于单元格注释文本
问题描述
我不确定它是否可能,但我想做的是检查 IF 函数中特定字符串的单元格注释文本
IE =IF(MID(CellA.CommentText,3,3) = "XYZ", {True},{False})
解决方案
没有 Excel 公式可以引用没有 VBA 用户定义函数的注释。
要做到这一点,你需要这样的东西:
Public Function GetCellComment(Target As Range) AS Variant
On Error Resume Next 'In case reference is invalid, no comment exists, etc
GetCellComment = Target.Cells(1, 1).Comment.Text
End Function
(如果 - 并且仅当 -当工作簿中的任何单元格发生更改时,您绝对需要重新计算该函数,您可以在 .之前添加该行。但是,过度使用它会使工作簿运行缓慢,因此请谨慎使用)Application.Volatile
On Error Resume Next
然后在 Excel 函数中使用它:
=IF(MID(GetCellComment(CellA), 3, 3) = "XYZ", {True},{False})
推荐阅读
- routes - Nuxt 子域路由
- python - 在 Python 中添加列表与扩展列表
- javascript - 如何访问函数对象中的函数?
- azure - 如何在azure数据流中处理excel
- python - python http请求(requests.get)已停止工作
- ios - 重新加载部分后无法取消选择 tableView 行
- c# - 无法为我的控制器解决类型错误的服务
- mysql - Windows 应用程序使用什么数据库,在应用程序启动时运行?
- apache-camel - Camunda 与 camunda-bpm-camel 社区版的集成删除了路由之间的交换属性集
- python - 暂停任务队列