Skip to content
本页内容

Names (属性)

返回一个 Names 集合,它代表指定工作簿的所有名称(包括所有指定工作表的名称)。 Names 对象,只读。

说明

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

示例

python
#本示例是将 Sheet1 中的 A1 单元格的名称定义为“myName”
def test():
    Application.ActiveWorkbook.Names.Add("myName", None, None, None, None, None, None, None, None, "=Sheet1!R1C1")
python
#本示例是将 Sheet1 中的 C1 单元格的名称定义为“myCell”
def test():
    Application.ActiveWorkbook.Names.Add("myCell", "=Sheet1!$C$1")