Skip to content
本页内容

Sheets (属性)

返回一个 Sheets 集合,它代表指定工作簿中所有工作表。 Sheets 对象,只读。

说明

在不使用对象识别符的情况下使用此属性等效于使用 ActiveWorkbook.Sheets

示例

python
#此示例新建一张工作表,然后在第一列中列出活动工作簿中的工作表名称
def test():
    newSheet = Application.Sheets.Add(None, None, None, xlWorksheet)
    for i in range(1, Application.Sheets.Count):
        newSheet.Cells.Item(i, 1).Value2 = Application.Sheets.Item(i).Name
python
#此示例演示工作表的总数量
def test():
    print("工作表的总数量:" + Application.Sheets.Count)