Hi folks..
I have a macro, and it mainly works, except the second part where it checks if the value is less than 7, and returns it to a white background.
The cell has a formula in it that returns "" based on another series of cells. I have considered changing that to a zero and formating, but for reasons that don't need explanation, i have chosen not to.
here is the macro. I need the second part to be activated if less than 7, as well as if the cell returns ""
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim lrow As Long
Dim i As Integer
Dim WSRec As Worksheet
Set WSRec = Sheets("Payables")
lrow = WSRec.Range("f65536").End(xlUp).Row
For i = 13 To lrow
If WSRec.Cells(i, 10).Value > 7 Then
WSRec.Cells(i, 10).Select
With Selection.Font
.FontStyle = "Bold"
End With
With Selection.Interior
.Color = 255
End With
End If
If WSRec.Cells(i, 10).Value < 7 Then
WSRec.Cells(i, 10).Select
With Selection.Font
.FontStyle = "Regular"
End With
With Selection.Interior
.Color = RGB(255, 255, 255)
End With
End If
Next
End Sub
Thanks in advance.
Bookmarks