Name Property

Returns or sets the name of the specified object.

  • Read/write Variant for the Font object.

  • Read/write for the Range object. Returns a Name object. Set using a String.

  • Read/write String for the ChAxis, ChChart, ChFont, ChSeries, GroupingDef, Name, PageField, PivotFont, PivotHyperlink, PivotTotal, RecordsetDef, SchemaField, SchemaRowsource, and Worksheet objects.

  • Read-only String for all other objects in the Applies To list.

expression.Name

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

Remarks

Only one case for PivotField.Name is read/write. The special read/write case is for the calculated field of the PivotField object.

Example

This example sets the name of the specified chart.

ChartSpace1.Charts(0).Name = "Line Chart"

After the chart name has been set, you can refer to the chart by name, as shown in the following example.

ChartSpace1.Charts("Line Chart").HasLegend = True

Applies to | ChAxis Object | ChChart Object | ChFont Object | ChSeries Object | Font Object | GroupingDef Object | Hyperlink Object | ListObject Object | Name Object | PageField Object | PageRelationship Object | PageRowsource Object | ParameterValue Object | PivotAggregate Object | PivotAxisMember Object | PivotColumnMember Object | PivotField Object | PivotFieldSet Object | PivotFont Object | PivotHyperlink Object | PivotMember Object | PivotMemberProperty Object | PivotPageMember Object | PivotResultMemberProperty Object | PivotRowMember Object | PivotTotal Object | Range Object | RecordsetDef Object | SchemaField Object | SchemaParameter Object | SchemaProperty Object | SchemaRelatedField Object | SchemaRelationship Object | SchemaRowsource Object | Spreadsheet Object | Workbook Object | Worksheet Object

See Also | BaseName Property