In the following code I've just concentrated on highlighting, not bothering with the progress bar. I've also changed the ColorWholeRow sub to prevent it selecting anything and to take an argument:
Sub CompareAccounts4()
Set NewSht = Sheets(1)
Set OldSht = Sheets(2)
'Determine the range on the newer sheet:
Set lastcell = NewSht.Range("A5")
Do Until IsEmpty(lastcell.Offset(1))
Set lastcell = lastcell.Offset(1)
Loop
Set NewCells = Range(NewSht.Range("A5"), lastcell).Offset(, 3)
'Determine the range on the older sheet:
Set lastcell = OldSht.Range("A5")
Do Until IsEmpty(lastcell.Offset(1))
Set lastcell = lastcell.Offset(1)
Loop
Set OldCells = Range(OldSht.Range("A5"), lastcell).Offset(, 3)
'At this stage we have OldCells which is the range of older inv#s,and NewCells which is the range of New Inv#s.
For Each NewCell In NewCells.Cells
For Each OldCell In OldCells.Cells
If OldCell.Value = NewCell.Value Then
If OldCell.Offset(, 2) <> NewCell.Offset(, 2) Or OldCell.Offset(, 5) <> NewCell.Offset(, 5) Or OldCell.Offset(, 6) <> NewCell.Offset(, 6) Then ColorWholeRow NewCell
Exit For 'omit if you want to keep on looking down OldCells for more matches
End If
Next OldCell
Next NewCell
End Sub
Sub ColorWholeRow(TheCell)
With TheCell.EntireRow.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
'.ColorIndex = 3 'I was using Excel2003
.ThemeColor = xlThemeColorAccent1 'commented out for Excel2003
.TintAndShade = 0.799981688894314 'commented out for Excel2003
.PatternTintAndShade = 0 'commented out for Excel2003
End With
End Sub
What this code won't do is highlight new invoice numbers (neither would your code have) but this can be tweaked..