Sub 标色() Dim se(1 To 5) As Integer se(1) = 3 se(2) = 7 se(3) = 38 se(4) = 64 se(5) = 33 k = 1 Range("a1:a" & [a65536].End(xlUp).Row).Interior.ColorIndex = xlNone For i = 1 To [a65536].End(xlUp).Row Step 3 For j = i + 3 To [a65536].End(xlUp).Row Step 3 If Cells(i, 1) = Cells(j, 1) Then If Abs(Cells(i + 1, 1) - Cells(j + 1, 1)) = [c1] Then Cells(i, 1).Interior.ColorIndex = se(k) Cells(i + 1, 1).Interior.ColorIndex = se(k) Cells(j, 1).Interior.ColorIndex = se(k) Cells(j + 1, 1).Interior.ColorIndex = se(k) k = k + 1 End If End If Next Next End Sub 不知道符合不符合
Sub 标色() Dim se(1 To 5) As Integer se(1) = 3 se(2) = 7 se(3) = 38 se(4) = 64 se(5) = 33 k = 1 Range("a1:a" & [a65536].End(xlUp).Row).Interior.ColorIndex = xlNone For i = 1 To [a65536].End(xlUp).Row Step 3 For j = i + 3 To [a65536].End(xlUp).Row Step 3 If Cells(i, 1) = Cells(j, 1) Then If Abs(Cells(i + 1, 1) - Cells(j + 1, 1)) = [c1] Then Cells(i, 1).Interior.ColorIndex = se(k) Cells(i + 1, 1).Interior.ColorIndex = se(k) Cells(j, 1).Interior.ColorIndex = se(k) Cells(j + 1, 1).Interior.ColorIndex = se(k) k = k + 1 End If End If Next Next End Sub 不知道符合不符合