2005-03-16

[Computer] Excel Macro - 隔行著色

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False Cells.Select

Selection.Interior.ColorIndex = xlNone
i = 1
Do Until Cells(i, 1).Value = ""
Rows(i + 1).Select
With Selection.Interior
.ColorIndex = 19
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
i = i + 2
Loop

Application.ScreenUpdating = True

End Sub

沒有留言: