NativeExcel for .Net Developer's Reference

IRange.DeleteMethod()

Deletes a cell or a range of cells from the worksheet and shifts other cells up to replace deleted cells.

[Visual Basic]
SubDelete()
[C#]
voidDelete();
[C++]
voidDelete();
[JScript]
functionDelete();

Example

This example deletes range D2:F5 from sheet one and shifts other cells up.

[C#]
 book.Worksheets[1].Range["D2:F5"].Delete(); 
[VisualBasic]
 book.Worksheets(1).Range("D2:F5").Delete()
[C++]
 book->Worksheets->Item[1]->Range->Item[S"D2:F5"]->Delete(); 

See Also

IRange Interface | NativeExcel Namespace | IRange.Delete Overload List | Insert Method