I'm having a difficult time with how I can use a variant with a conditional formatting formula.
This is what I have
condition3 is where I'm having trouble. What I'm trying to accomplish is if any cell in column V = "No", then apply the red background to both cells in V and W. Perhaps there is a better way to write this?
Thank you
This is what I have
VBA Code:
Dim rng As Variant
Set rng = Range("V2:V" & Range("A" & Rows.Count).End(xlUp).Row)
rng.FormatConditions.Add Type:=xlTextString, String:="No", TextOperator:=xlContains
rng.FormatConditions(1).Interior.Color = 255 ' Red
rng.FormatConditions(1).Font.ThemeColor = xlThemeColorDark1
rng.FormatConditions(1).Font.Bold = True
rng.FormatConditions(1).StopIfTrue = False
rng.FormatConditions.Add Type:=xlTextString, String:="Yes", TextOperator:=xlContains
rng.FormatConditions(2).Interior.Color = 5287936 ' Green
rng.FormatConditions(2).Font.ThemeColor = xlThemeColorDark1
rng.FormatConditions(2).Font.Bold = True
rng.FormatConditions(2).StopIfTrue = False
rng.Offset(0, 1).FormatConditions.Add Type:=xlExpression, Formula1:="=$V$35=""No""" 'this is where I'm hung up
rng.FormatConditions(3).Interior.Color = 255 ' Red
rng.FormatConditions(3).Font.ThemeColor = xlThemeColorDark1
rng.FormatConditions(3).Font.Bold = True
rng.FormatConditions(3).StopIfTrue = False
condition3 is where I'm having trouble. What I'm trying to accomplish is if any cell in column V = "No", then apply the red background to both cells in V and W. Perhaps there is a better way to write this?
Thank you