Excel 带“的条件格式”;及;功能
我尝试在条件格式的公式中包含2个条件和函数,但没有成功 下面是我的代码,但我在公式部分有一个问题 谢谢你的帮助Excel 带“的条件格式”;及;功能,excel,vba,Excel,Vba,我尝试在条件格式的公式中包含2个条件和函数,但没有成功 下面是我的代码,但我在公式部分有一个问题 谢谢你的帮助 Columns("Y:Y").Select Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=AND(ISNUMBER($J1);ISNUMBER($J2);$Y1<>$Y2)" With Selection.FormatConditions(1)
Columns("Y:Y").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=AND(ISNUMBER($J1);ISNUMBER($J2);$Y1<>$Y2)"
With Selection.FormatConditions(1)
.Font.Color = RGB(174, 37, 42)
.Interior.Color = RGB(255, 200, 205)
End With
Selection.FormatConditions(1).StopIfTrue = False
列(“Y:Y”)。选择
Selection.FormatConditions.Add类型:=xlExpression,公式1:“=和(ISNUMBER($J1);ISNUMBER($J2);$Y1$Y2)”
带Selection.FormatConditions(1)
.Font.Color=RGB(174,37,42)
.Interior.Color=RGB(255200205)
以
Selection.FormatConditions(1).StopIfTrue=False
条件格式
- 使用
可以确保应用的条件格式是唯一的格式.FormatConditions.Delete
- 如果已经有一些条件格式,并且您想添加一个新的,那么您必须注释(删除)行
.FormatConditions.delete
- 如果您尝试应用的格式是唯一的格式,则可以使用
而不是1
(最后添加的CF)。但是,既然显式编号可能只有在有多种格式时才有用,为什么还要麻烦呢.FormatConditions.Count
选项显式
子测试()
带列(“Y”)
.FormatConditions.Delete“删除以前的任何条件格式。
.FormatConditions.Add类型:=Xexpression_
公式1:=“=和(ISNUMBER($J1);ISNUMBER($J2);$Y1$Y2)”
刚刚添加了.FormatConditions(.FormatConditions.Count)'CF
.Font.Color=RGB(174,37,42)
.Interior.Color=RGB(255200205)
.StopIfTrue=False
以
以
端接头