'同行左右判断,你这是全部判断的吧,40也并不唯一
Option Explicit
Sub abc()
Dim i
[a1].CurrentRegion.Interior.ColorIndex = xlNone
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row
If Cells(i, 1).Value <> Cells(i, 2).Value Then
Cells(i, 1).Resize(, 2).Interior.Color = vbYellow
End If
Next
End Sub