VBA--改变Tab的颜色 (18种颜色走马灯)

Public Sub Colr()
    If testing Then Exit Sub
    If ActiveSheet.Tab.ColorIndex >= 18 Or ActiveSheet.Tab.ColorIndex < 1 Then
        ActiveSheet.Tab.ColorIndex = 1
    Else
        ActiveSheet.Tab.ColorIndex = CInt(ActiveSheet.Tab.ColorIndex + 1)
    End If
End Sub

你可能感兴趣的:(VBA--改变Tab的颜色 (18种颜色走马灯))