cortexnotion
Board Regular
- Joined
- Jan 22, 2020
- Messages
- 150
- Office Version
- 2013
- Platform
- Windows
Hi All
I am applying conditional formatting to several columns and the formatting is always vbYellow (code below). I would now like to highlight column A in vbRed with any rows that contain any vbYellow cells. Is this possible?
Thanks
I am applying conditional formatting to several columns and the formatting is always vbYellow (code below). I would now like to highlight column A in vbRed with any rows that contain any vbYellow cells. Is this possible?
Thanks
VBA Code:
With wbfeedback.Sheets("Feedback")
LR3 = .Range("A" & Rows.Count).End(xlUp).Row
With .Range("C2:C" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=($C2="""")"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("D2:D" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($C2=""" & TypeAry(3) & """,$D2="""")"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("E2:E" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($C2<>"""",$C2<>""" & TypeAry(0) & """,OR($E2="""",$E2=""Unknown""))"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("F2:F" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=OR($F2="""",$F2=""Unknown"")"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("H2:H" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($C2=""" & TypeAry(0) & """,OR($H2="""",$H2=""Unknown""))"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("I2:I" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($C2=""" & TypeAry(0) & """,OR($F2=""" & AssetAry(0) & """,$F2=""" & AssetAry(1) & """,$F2=""" & AssetAry(2) & """)" & _
",OR($I2="""",$I2=""Unknown""))"
.FormatConditions(1).Interior.Color = vbYellow
End With
With .Range("J2:J" & LR3)
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($C2=""" & TypeAry(0) & """" & _
",OR($F2=""" & AssetAry(0) & """,$F2=""" & AssetAry(1) & """,$F2=""" & AssetAry(2) & """,$F2=""" & AssetAry(3) & """,$F2=""" & AssetAry(4) & """,$F2=""" & AssetAry(5) & """" & _
"),OR($J2="""",$J2=""Unknown""))"
.FormatConditions(1).Interior.Color = vbYellow
End With
End With