Delete Method

Applies To

Axis object, AxisTitle object, ChartTitle object, DataLabel object, DataLabels collection object, DataTable object, DownBars object, DropLines object, ErrorBars object, Gridlines object, HiLoLines object, LeaderLines object, Legend object, LegendEntry object, LegendKey object, Point object, Range object, Series object, SeriesLines object, TickLabels object, Trendline object, UpBars object.

Description

Deletes the specified object. Syntax 2 applies only to Range objects.

Syntax 1

expression.Delete

Syntax 2

expression.Delete(Shift)

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

Shift Optional Variant. Used only with Range objects. Specifies how to shift cells to replace deleted cells. Can be one of the following XlDeleteShiftDirection constants: xlShiftToLeft or xlShiftUp. If this argument is omitted, Microsoft Graph decides based on the shape of the 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