Option Explicit
Sub demo()
Dim rng
Dim lc As Long, lr As Long, icol As Long, irow As Long
Application.ScreenUpdating = False
lc = Cells(1, Columns.Count).End(xlToLeft).Column
lr = Cells(Rows.Count, "A").End(xlUp).Row
Range("D2:F" & lr).Interior.Pattern = xlNone
For icol = 4 To lc
For irow = 2 To lr - 1 Step 2
If Not IsEmpty(Cells(irow, icol)) Then
If Cells(irow + 1, icol) = 0 Then
Cells(irow, icol).Resize(2, 1).Interior.Color = RGB(240, 100, 100)
Else
If Cells(irow, icol) > Cells(irow + 1, icol) Then
Cells(irow, icol).Resize(2, 1).Interior.Color = RGB(255, 180, 100)
Else
If Cells(irow, icol) < Cells(irow + 1, icol) Then
Cells(irow, icol).Resize(2, 1).Interior.Color = RGB(240, 80, 170)
Else
If Cells(irow, icol) = Cells(irow + 1, icol) Then Cells(irow, icol).Resize(2, 1).Interior.Color = RGB(60, 180, 70)
End If
End If
End If
End If
Next irow
Next icol
Application.ScreenUpdating = True
End Sub
results in Sheet2: note there are no GREEN as no exact matches!
Bookmarks