r = Range("a65536").End(xlUp).Row
Range("d3:m65536").Interior.ColorIndex = xlNone
On Error Resume Next
For i = 3 To r
Set x = Range(Cells(i, "d"), Cells(i, "m"))
Do
Err.Clear
Set x = x.RowDifferences(x(1))
If Err.Number Then Exit Do
x.Interior.Color = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Loop
Next i
End Sub
r = Range("a65536").End(xlUp).Row
Range("d3:m65536").Interior.ColorIndex = xlNone
On Error Resume Next
For i = 3 To r
Set x = Range(Cells(i, "d"), Cells(i, "m"))
Do
Err.Clear
Set x = x.RowDifferences(x(1))
If Err.Number Then Exit Do
If x.Count = 1 Then Exit Do
x.Interior.Color = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Loop
Next i
End Sub 工资发放登记2.rar(18.32 KB, 下载次数: 10)
r = Range("a65536").End(xlUp).Row
Range("d3:m65536").Interior.ColorIndex = xlNone
On Error Resume Next
For i = 3 To r
Set x = Range(Cells(i, "d"), Cells(i, "m"))
Do
Err.Clear
Set x = x.RowDifferences(x(1))
If Err.Number Then Exit Do
x.Interior.Color = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Loop
Next i
End Sub