本帖最后由 森林狼 于 2012-10-17 23:00 编辑
Range("C2:D60000").Interior.ColorIndex = xlNone
Dim x, y
For x = 2 To Range("a65536").End(xlUp).Row
For y = x + 1 To Range("a65536").End(xlUp).Row
If Cells(y, 2) = Cells(x, 2) And ((Cells(y, 3) < Cells(x, 4) And Cells(y, 3) >= Cells(x, 3)) Or (Cells(y, 4) <= Cells(x, 4) And Cells(y, 4) > Cells(x, 3))) Then
Cells(x, 3).Interior.ColorIndex = 6
Cells(x, 4).Interior.ColorIndex = 6
Cells(y, 3).Interior.ColorIndex = 6
Cells(y, 4).Interior.ColorIndex = 6
Else
End If
Next
Next