D
DavidH56
Hi,
I ran this code but when column G is less than 0, J is the only column that
dose not highlight the font red. I would appreciate any assistance.
Sub CondfmtLateEvents()
'Simulate conditional formatting
Dim rng1, rng2, cell As Range
Set rng1 = Range(Cells(1, 7), Cells(Rows.Count, 7).End(xlUp))
Set rng2 = Range(Cells(1, 10), Cells(Rows.Count, 10).End(xlUp))
'color entire row if column G is less than 0 and column H is null
For Each cell In rng1
If cell.Value < 0 And cell.Offset(0, 1) = "" Then
cell.EntireRow.Font.ColorIndex = 3
Else
cell.EntireRow.Font.ColorIndex = xlAutomatic
End If
Next
'color font in column J it is less than 0 and column H is null
For Each cell In rng2
If cell.Value < 0 And cell.Offset(0, -3) > 0 And cell.Offset(0, -2) = ""
Then
cell.Font.ColorIndex = 3
Else
cell.Font.ColorIndex = xlAutomatic
End If
Next
End Sub
Thank you.
I ran this code but when column G is less than 0, J is the only column that
dose not highlight the font red. I would appreciate any assistance.
Sub CondfmtLateEvents()
'Simulate conditional formatting
Dim rng1, rng2, cell As Range
Set rng1 = Range(Cells(1, 7), Cells(Rows.Count, 7).End(xlUp))
Set rng2 = Range(Cells(1, 10), Cells(Rows.Count, 10).End(xlUp))
'color entire row if column G is less than 0 and column H is null
For Each cell In rng1
If cell.Value < 0 And cell.Offset(0, 1) = "" Then
cell.EntireRow.Font.ColorIndex = 3
Else
cell.EntireRow.Font.ColorIndex = xlAutomatic
End If
Next
'color font in column J it is less than 0 and column H is null
For Each cell In rng2
If cell.Value < 0 And cell.Offset(0, -3) > 0 And cell.Offset(0, -2) = ""
Then
cell.Font.ColorIndex = 3
Else
cell.Font.ColorIndex = xlAutomatic
End If
Next
End Sub
Thank you.