Clear method (Excel Graph)

The Clear method as it applies to the ChartArea, Legend, and Range objects.

ChartArea and Legend objects

Clears the entire chart area.

Syntax

expression.Clear

expression Required. An expression that returns a ChartArea or Legend object.

Range object

Clears the entire range.

Syntax

expression.Clear

expression Required. An expression that returns a Range object.

Example

This example clears the formulas and formatting in cells A1:G37 on the datasheet.

myChart.Application.DataSheet.Range("A1:G37").Clear

This example clears the chart area (the chart data and formatting) of Chart1.

myChart.ChartArea.Clear

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.