Charts Method

Applies To

Application Object, Workbook Object.

Description

Accessor. Returns an object that represents a single chart (a Chart object, Syntax 1) or a collection of the charts (a Charts object, Syntax 2) in the workbook.

Syntax 1

object.Charts(index)

Syntax 2

object.Charts

object

Optional for Application, required for Workbook. The object to which this method applies.

index

Required for Syntax 1. The name or number of the chart (can be an array to specify more than one).

Remarks

Using this method with no object qualifier is equivalent to ActiveWorkbook.Charts.

See Also

ChartObjects Method.

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. Note that in this example (and the previous one), the Charts method returns a Sheets object instead of a Charts object.


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