Hi Tony..
Try this code & a workbook is attached for you to play with.
I think it does what you're after.
Option Explicit
Sub SumFormat()
Application.ScreenUpdating = False
Dim Wsht1 As Worksheet ' Worksheet 1
Dim Col3Range As Range ' Column C
Dim Col1Cell As Range
Dim Col2Cell As Range
Dim Col3Cell As Range
Dim TopRow As Long ' Top row number where data starts
TopRow = 1
Set Wsht1 = ThisWorkbook.Sheets(1)
Set Col3Range = Wsht1.Range(Wsht1.Cells(TopRow, 3), Wsht1.Cells(Rows.Count, 3).End(xlUp))
Set Col1Cell = Wsht1.Cells(TopRow, 1) ' A1
Set Col2Cell = Wsht1.Cells(TopRow, 2) ' B1
Set Col3Cell = Wsht1.Cells(TopRow, 3) ' C1
Col3Range.ClearFormats ' Clear any previous formatting
For Each Col3Cell In Col3Range
If Col1Cell.Value + Col2Cell.Value <> Col3Cell.Value Then ' Condition is met
With Col3Cell
.Interior.Color = RGB(218, 150, 150) ' Light Red
.BorderAround LineStyle:=xlContinuous, Weight:=xlThin, Color:=RGB(255, 0, 0) ' Red Border
End With
' Move down a row
TopRow = TopRow + 1
Set Col1Cell = Wsht1.Cells(TopRow, 1)
Set Col2Cell = Wsht1.Cells(TopRow, 2)
Else ' If the condition wasn't met
' Move down a row
TopRow = TopRow + 1
Set Col1Cell = Wsht1.Cells(TopRow, 1)
Set Col2Cell = Wsht1.Cells(TopRow, 2)
End If
Next Col3Cell
Application.ScreenUpdating = True
End
End Sub
Bookmarks