I have a piece of code that I cant figure out.
basically I want rows in the select range (A to N) to be highlighted if the cell in column N contains "High". "Medium" or Low". My code only works on cells in column N.
basically I want rows in the select range (A to N) to be highlighted if the cell in column N contains "High". "Medium" or Low". My code only works on cells in column N.
VBA Code:
Dim lLR As Long
lLR = Range("N" & Rows.Count).End(xlUp).Row 'Last Row Found here!
With Range("A2:N" & lLR) 'Last Row used here!
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlTextString, String:="High", TextOperator:=xlContains
.FormatConditions(1).Interior.Color = RGB(255, 199, 206)
.FormatConditions(1).Font.Color = RGB(156, 0, 6)
.FormatConditions.Add Type:=xlTextString, String:="Medium", TextOperator:=xlContains
.FormatConditions(2).Interior.Color = RGB(255, 235, 156)
.FormatConditions(2).Font.Color = RGB(156, 0, 6)
.FormatConditions.Add Type:=xlTextString, String:="Low", TextOperator:=xlContains
.FormatConditions(3).Interior.Color = RGB(198, 239, 206)
.FormatConditions(3).Font.Color = RGB(156, 0, 6)
End With
Range("P1:Q1").Interior.Color = 65535
Range("A1:Q1").Font.Bold = True