excel比较每两行数据是否一样
Sub 宏1()
For x = 2 To ActiveSheet.UsedRange.Rows.Count Step 2
For y = 2 To ActiveSheet.UsedRange.Columns.Count
If Cells(x, y) <> Cells(x + 1, y) Then
Range(Cells(x, y), Cells(x + 1, y)).Interior.ColorIndex = 6
End If
Next
Next
End Sub
时间: 2024-10-16 18:19:30