Villalobos
Active Member
Hello,
I would some help regarding conditional formatting with formula. My target is to change the interior color of cell (in column L until the lastrow -the original file has some thousand rows-) if the formula is turn to "true". Unfortunately I receive "Invalid procedure or argument" error msg at this line:
The full code is here:
Could somebody give me some advice how to solve this problem?
I attached the sample file as well.
Thanks in advance the help!
I would some help regarding conditional formatting with formula. My target is to change the interior color of cell (in column L until the lastrow -the original file has some thousand rows-) if the formula is turn to "true". Unfortunately I receive "Invalid procedure or argument" error msg at this line:
Code:
.Range("L9:L" & OutputLastRow).FormatConditions.Add Type:=xlExpression, Formula1:="=AND(J9>0,K9<J9,O9>0,P9>TODAY())"
The full code is here:
Code:
Sub test()
Dim outputSheet4 As Worksheet
Dim OutputLastRow As Long
Set outputSheet4 = Worksheets("Evaluation")
With outputSheet4
OutputLastRow = .Cells(.Rows.Count, "L").End(xlUp).Row
.Range("L9:L" & OutputLastRow).FormatConditions.Delete
.Range("L9:L" & OutputLastRow).FormatConditions.Add Type:=xlExpression, Formula1:="=AND(J9>0,K9<J9,O9>0,P9>TODAY())"
.Range("L9:L" & OutputLastRow).FormatConditions(1).Interior.Color = RGB(255, 0, 0)
.Range("L9:L" & OutputLastRow).FormatConditions(1).Font.Color = RGB(255, 255, 255)
.Range("L9:L" & OutputLastRow).FormatConditions(1).Font.Bold = True
End With
End Sub
Could somebody give me some advice how to solve this problem?
I attached the sample file as well.
Thanks in advance the help!