NativeExcel2 for .Net Developer's Reference

IRangeColumns.DeleteMethod

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

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

Example

This example deletes columns one through five from sheet one and shifts other cells left.

[C#]
 book.Worksheets[1].Cells["A1:F1"].EntireColumn.Delete(); 
[VisualBasic]
 book.Worksheets(1).Cells["A1:F1"].EntireColumn.Delete()
[C++]
 book->Worksheets->Item[1]->Cells->Item[S"A1:F1"]->EntireColumn->Delete(); 

See Also

IRangeColumns Interface | NativeExcel Namespace | Insert Method