|
楼主 |
发表于 2024-10-27 22:33
|
显示全部楼层
我把其他的工作表内容改为相同的形式了,但是我改了一下程序就出错,你看看是哪里出问题:
Sub test()
Application.ScreenUpdating = False
a = [{"Sheet1","Sheet2","Sheet3"}]
For Each aa In a
With Sheets(aa)
.UsedRange.Interior.Color = xlNone
Arr = .Range(.[a1], .UsedRange)
For j = 2 To UBound(Arr, 2) - 1
For i = 2 To UBound(Arr)
s = Arr(i, j)
For k = 2 To UBound(Arr)
If Right(Arr(k, j + 1), 2) = "00" Then
If Mid(Right(Arr(k, j + 1), 4), 1, 2) = Mid(Right(s, 4), 1, 2) Then
.Cells(i, j).Interior.Color = RGB(255, 192, 0)
End If
End If
Next
Next
Next
End With
Beep
Application.ScreenUpdating = True
End Sub |
|