Delete Method

Microsoft Office Web Components Object Model

Show All

Delete Method

       

Delete method as it applies to the Hyperlink, Name, PivotHyperlink, Sheets, Worksheet, and Worksheets objects.

Deletes the specified object.

expression.Delete

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

 

Delete method as it applies to the ChAxes, ChCharts, ChSeriesCollection, ElementExtensions, GroupingDefs, GroupLevels, LookupRelationships, PageFields, ParameterValues, RecordsetDefs, SchemaFields, SchemaRelationships, SchemaRowsources, and SublistRelationships objects.

Deletes a single object from the specified collection.

expression.Delete(Index)

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

Index   Required Variant. Specifies the name or number of the object to be deleted.

 

Delete method as it applies to the ChDataLabelsCollection, ChErrorBarsCollection, ChSegments and ChTrendlines objects.

Deletes a single object from the specified collection.

expression.Delete(Index)

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

Index   Required Long. Specifies the name or number of the object to be deleted.

 

Delete method as it applies to the Range object.

Deletes the specified cells from the worksheet.

expression.Delete(Shift)

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

Shift   Optional Variant. 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 Excel decides based on the shape of the range.

 

Example

This example deletes the data labels from the specified series in the chart workspace.

ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection.Delete 0