程式碼如下:
Sub VBAColor()
Dim i As Integer
For i = 1 To 56
If i < 29 Then
Cells(i, 1).Interior.ColorIndex = i
Cells(i, 2) = i
Else
Cells(i - 28, 3).Interior.ColorIndex = i
Cells(i - 28, 4) = i
End If
Next i
End Sub
畫面如下
沒有留言:
張貼留言