I want to apply conditional formatting through VBA if column E contains for example 1ST then I want to use mutiple conditional formatting rules for the 28 cells next to it.
For this moment I use
Sub SetFormulasFormat()
With ActiveSheet
For Each cl In Application.Intersect(.Columns("E"), .UsedRange)
' found upper row of the data in table
If UCase(cl.Text) = "1ST" Then
cl.Resize(, 1).FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=1"
cl.Resize(, 1).FormatConditions(1).Interior.Color = vbRed
cl.Resize(, 2).FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=3"
cl.Resize(, 2).FormatConditions(2).Interior.Color = vbRed
End If
Next cl
End With
End Sub
But I doesn't apply the second rule.
Example of my excel
Can someone help me?