NativeExcel for .Net Developer's Reference

IRange.DeleteMethod(XlDeleteShiftDirection)

Deletes a cell or a range of cells from the worksheet.

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

Parameters

Shift
XlDeleteShiftDirection. Specifies how to shift cells to replace deleted cells.

Example

This example deletes range A1:B7 from sheet one and shifts other cells left to replace deleted cells.

[C#]
 book.Worksheets[1].Range["A1:B7"].Delete(XlDeleteShiftDirection.xlShiftLeft); 
[VisualBasic]
 book.Worksheets(1).Range("A1:B7").Delete(XlDeleteShiftDirection.xlShiftLeft)
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:B7"]->Delete(XlDeleteShiftDirection::xlShiftLeft); 

See Also

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