[英]Conditional formatting based on the result of IF formula in the cell
有没有一种方法可以根据单元格中存在的IF条件的结果进行条件格式化,无论它返回什么?
就像如果返回true
则将其上色为绿色,如果为false
则将其上色为红色
该公式在sheet2 =IF(Sheet3!C35="", Sheet3!B35, Sheet3!C35)
上看起来像这样,它可以返回B或C列中的任何值,这使我很难使用硬编码有条件地对其进行格式设置值或范围,因为它们的定义不明确
我想通过这样的宏来做
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Target.Cells.Count = 1 And Target.Cells.HasFormula Then
'Logic to check the if condition
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.