Charts Property

Microsoft Excel Visual Basic

Show All

Charts Property

       

Charts Property as it applies to the Application object.

Returns a Sheets collection that represents all the chart sheets in the active workbook. Read-only.

expression.Charts

expression   Required. An expression that returns an object in the Applies To List.

Using this property without an object qualifier returns all chart sheets in the active workbook.

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

 

Charts Property as it applies to the Workbook object.

Returns a Sheets collection that represents all the chart sheets in the specified workbook. Read-only.

expression.Charts

expression   Required. An expression that returns an object in the Applies To List.

Using this property without an object qualifier returns all chart sheets in the active workbook.

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

 

Example

This example sets the text for the title of Chart1.

With Charts("Chart1")
    .HasTitle = True
    .ChartTitle.Text = "First Quarter Sales"
End With

This example deletes every chart sheet in the active workbook.

ActiveWorkbook.Charts.Delete

This example hides Chart1, Chart3, and Chart5.

Charts(Array("Chart1", "Chart3", "Chart5")).Visible = False