.
Hello Experts,
I have values in columns J and K. These values increase or decrease when I use an advanced filter. I need change the font color of the values in column K based on the values of column J.
Example:
If J9>K9, then the font color of K9 is red.
If J9<K9, then the font color of K9 is normal (black).
I put in the conditional formatting menu: (column K)
this formula works OK.
But, I do need make it with VBA code. So, I wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 11 Then
If Target.Offset(0, -1).Value > Target.Value Then
Target.Font.ColorIndex = 3
End If
End If
End Sub
This code has a problem, cause only change the font color one time. If I use the advanced filter nothing happens in column K when the values change.
In short, what I need is a VBA code that works exactly as the same of conditional formatting.
Please, help me.
Thanks so much in advance.
regards,
.