Names Property

Microsoft Excel Visual Basic

collection that represents all the names in the active workbook. For a Workbook object, returns a Names collection that represents all the names in the specified workbook (including all worksheet-specific names). For a Worksheet object, returns a Names collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix). Read-only Names object.

expression.Names

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

For information about returning a single member of a collection, see Returning an Object from a Collection.

Using this property without an object qualifier is equivalent to using ActiveWorkbook.Names.

Example

This example defines the name "myName" for cell A1 on Sheet1.

ActiveWorkbook.Names.Add Name:="myName", RefersToR1C1:= _
    "=Sheet1!R1C1"