Tab 对象

         
多个对象
Tab

代表图表或工作表中的标签。

Tab 对象用法

可用 Chart 对象或 Worksheet 对象的 Tab 属性返回一个 Tab 对象。

返回一个 Tab 对象后,便可用 ColorIndex 属性来确定图表或工作表的标签设置。

在本示例中,Microsoft Excel 判断工作表的第一个标签的颜色索引是否设置为无,并通知用户。

Sub CheckTab()

    ' Determine if color index of 1st tab is set to none.
    If Worksheets(1).Tab.ColorIndex = xlColorIndexNone Then
        MsgBox "The color index is set to none for the first " & _
            "worksheet tab."
    Else
        MsgBox "The color index for the tab of the first worksheet " & _
            "is not set none."
    End If

End Sub