'自己去改数字吧,看哪种颜色你满意
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim ar, br(), r&, c%
With UsedRange.Offset(3, 9).Resize(, 49)
.ClearContents
.Interior.Color = xlNone
End With
ar = Range([c4:i4], [c4:i4].End(4))
ReDim br(1 To UBound(ar), 1 To 49)
For r = 1 To UBound(ar)
For c = 1 To 6
br(r, ar(r, c)) = ar(r, c)
Cells(r + 3, ar(r, c) + 9).Interior.ColorIndex = 3
Next
br(r, ar(r, 7) + 33) = ar(r, 7)
Cells(r + 3, ar(r, 7) + 42).Interior.ColorIndex = 15
Next
[j4].Resize(r - 1, 49) = br
Application.ScreenUpdating = True
End Sub |