Name Property

Applies To

AddIn Object, Application Object, Arc Object, AxisTitle Object, Button Object, Chart Object, ChartArea Object, ChartObject Object, ChartTitle Object, CheckBox Object, Corners Object, DataLabel Object, DataLabels Collection, DialogFrame Object, DialogSheet Object, DownBars Object, Drawing Object, DropDown Object, DropLines Object, EditBox Object, ErrorBars Object, Floor Object, Font Object, Gridlines Object, GroupBox Object, GroupObject Object, HiLoLines Object, Label Object, Legend Object, Line Object, ListBox Object, Module Object, Name Object, OLEObject Object, OptionButton Object, Oval Object, Picture Object, PivotField Object, PivotItem Object, PivotTable Object, PlotArea Object, Range Object, Rectangle Object, Scenario Object, ScrollBar Object, Series Object, SeriesLines Object, Spinner Object, Style Object, TextBox Object, TickLabels Object, Toolbar Object, ToolbarButton Object, Trendline Object, UpBars Object, Walls Object, Workbook Object, Worksheet Object.

Description

Returns or sets the name of the object. See the Remarks section for details.

Remarks

The meaning of this property depends on the object, as shown in the following table. The name of a Range object is a Name object. For every other object, the name is a string.

Object

Name

AddIn

The filename of the add-in, not including its path on disk. Read-only.

Application

The name of the application. Read-only.

Chart

If the chart is a page in the workbook, this is the name of that page as shown on the tab. If the chart is an embedded object, it is the name of the object. Read-write.

Control or drawing object

The name of the control or drawing object, in the language of the macro. Read-write.

DataLabel

The name of the data label. Read-only.

DialogSheet, Module, Worksheet

The name of the sheet, as shown on the tab. Read-write.

Font

The name of the font.

Legend

The name of the legend. Read-only.

Name

The name itself. If it is one of the built-in names it will be translated to the language of the macro. Read-write.

OLEObject

The name of the object. Read-write.

PivotField

The name of the field in the PivotTable. Read-write.

PivotItem

The name of the item in the PivotTable field. Read-write.

PivotTable

The name of the PivotTable. Read-write.

Range

The name of the range (this is a Name object). Assign to this property to define a name. If the range has multiple names, returns the first one. Read-write.

Scenario

The name of the scenario. Read-write.

Series

The name of the series. Read-write.

Style

The name of the style. If the style is a built-in style, this will return the name of the style in the language of the macro. Read only.

Toolbar

The name of the toolbar, as a string. If the toolbar is built-in, returns the name in the language of the user. Read only.

ToolbarButton

The name of the button, as a string. Read-write.

Trendline

The name of the trendline as it will appear in the legend. Read-write.

Workbook

The name of the workbook, not including its path on disk. Read-only .


See Also

NameLocal Property.

Example

This example displays the name and localized name of style one in the active workbook.


With ActiveWorkbook.Styles(1)
    MsgBox "The name of the style is " & .Name
    MsgBox "The localized name of the style is " & .NameLocal
End With