Compartilhar via


Name Interface

Represents a defined name for a range of cells.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("000208B9-0000-0000-C000-000000000046")> _
Public Interface Name
'Usage
Dim instance As Name
[InterfaceTypeAttribute()]
[GuidAttribute("000208B9-0000-0000-C000-000000000046")]
public interface Name

Remarks

Names can be either built-in names — such as Database, Print_Area, and Auto_Open — or custom names.

Application, Workbook, and Worksheet Objects

The Name object is a member of the Names collection for the Application, Workbook, and Worksheet objects. Use Names(index), where index is the name index number or defined name, to return a single Name object.

The index number indicates the position of the name within the collection. Names are placed in alphabetic order, from a to z, and are not case-sensitive (this is the same order as is displayed in the Define Name and Apply Names dialog boxes, returned by clicking the Name command on the Insert menu).

Use the Name property to return or set the text of the name itself.

Range Objects

Although a Range object can have more than one name, there’s no Names collection for the Range object. Use Name with a Range object to return the first name from the list of names (sorted alphabetically) assigned to the range.

See Also

Reference

Name Members

Microsoft.Office.Interop.Excel Namespace