Delete method (Excel Graph)

The Delete method as it applies to all objects in the Applies To list except the Range object, and then to the Range object.

All objects except the Range object

Applies to all objects in the Applies To list except the Range object.

Deletes the specified object.

Syntax

expression.Delete

expression Required. An expression that returns one of the above objects.

Range object

Applies to the Range object.

Deletes the specified object.

Syntax

expression.Delete (Shift)

expression Required. An expression that returns a Range object.

Parameters

Name Required/Optional Data type Description
Shift _Optional XlDeleteShiftDirection Used only with Range objects. Specifies how to shift cells to replace deleted cells.

Can be one of these XlDeleteShiftDirection constants: xlShiftToLeft or xlShiftUp.

If this argument is omitted, Graph decides how to shift cells based on the shape of the specified range.

Remarks

Deleting a Point or LegendKey object deletes the entire series.

Example

This example deletes cells A1:D10 on the datasheet and shifts the remaining cells to the left.

Set mySheet = myChart.Application.DataSheet 
mySheet.Range("A1:D10").Delete Shift:=xlShiftToLeft

This example deletes the chart title.

myChart.ChartTitle.Delete

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.