Names Collection Object

Description

A collection of all the Name objects in the specified or active workbook. Each Name object represents a defined name for a range of cells. Names can be built-in, such as Database, Print_Area, and Auto_Open, or they can be custom names.

Accessors

Use the Names method with an argument to access a single member of the collection or without an argument to access the entire collection at once.

Use the Add method to create a name and add it to the collection. The refersTo argument must be specified in A1-style notation, including dollar signs ($) where appropriate. For example, if cell A10 is selected on sheet1, and you define a name using the refersTo argument "=sheet1!A1:B1", the new name actually refers to cells A10:B10 (because you specified a relative reference). To specify an absolute reference, use "=sheet1!$A$1:$B$1".

The following example creates a new name that refers to cells A1:C20 on the worksheet named "Sheet1."


Names.Add "test", "=sheet1!$a$1:$c$20"

Properties

Application Property, Count Property, Creator Property, Parent Property.

Methods

Add Method (Names Collection), Item Method.