Exceldude88
New Member
- Joined
- Apr 24, 2017
- Messages
- 15
I am trying to make an excel sheet turn a hole row red when a value in the L column is before the current date, The first code succeeds in only turning the cell in the column red. Additionally, in the k column cell (second code) if the date is less than the L column date I need it to turn the whole row green.
Thank You,
Sub test()
With ThisWorkbook.Worksheets("Sheet1").Range("L:L").FormatConditions
.Add Type:=xlExpression, Formula1:="=AND(L1<>"""",L1<today())"
With .Item(.Count)
.Interior.Color = RGB(255, 0, 0)
.SetFirstPriority
End With
End With
End Sub
Sub test1()
With ThisWorkbook.Worksheets("Sheet1").Range("K:K").FormatConditions
.Add Type:=xlExpression, Formula1:="=AND(K1<>"""",K1<l1())"
With .Item(.Count)
.Interior.Color = RGB(0, 255, 0)
.SetFirstPriority
End With
End With
End Sub
</l1())"
</today())"
Thank You,
Sub test()
With ThisWorkbook.Worksheets("Sheet1").Range("L:L").FormatConditions
.Add Type:=xlExpression, Formula1:="=AND(L1<>"""",L1<today())"
With .Item(.Count)
.Interior.Color = RGB(255, 0, 0)
.SetFirstPriority
End With
End With
End Sub
Sub test1()
With ThisWorkbook.Worksheets("Sheet1").Range("K:K").FormatConditions
.Add Type:=xlExpression, Formula1:="=AND(K1<>"""",K1<l1())"
With .Item(.Count)
.Interior.Color = RGB(0, 255, 0)
.SetFirstPriority
End With
End With
End Sub
</l1())"
</today())"
Last edited: