Get Started
Documentation

Merge

Merge(isMerge)

Merge the selected cell range into a single cell or a cell row.

Parameters:

Name Type Description
isMerge boolean When set to true, the cells within the selected range will be merged along the rows, but remain split in the columns. When set to false, the whole selected range of cells will be merged into a single cell.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A3:E8").Merge(true);
oWorksheet.GetRange("A9:E14").Merge(false);
builder.SaveFile("xlsx", "Merge.xlsx");
builder.CloseFile();

Resulting document