Get Started
Usage API
More information

Delete

Delete(shift)

Deletes the Range object.

Parameters:

Name Type Description
shift String

Specifies how to shift cells to replace the deleted cells ("up", "left").

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("B4").SetValue("1");
oWorksheet.GetRange("C4").SetValue("2");
oWorksheet.GetRange("D4").SetValue("3");
oWorksheet.GetRange("C5").SetValue("5");
var oRange = oWorksheet.GetRange("C4");
oRange.Delete("up");
builder.SaveFile("xlsx", "Delete.xlsx");
builder.CloseFile();

Resulting document