Merging column and rows

Hi,

Can you help me with code to merge columns and rows. I have attached expected output for your referenceeExpected Output.docx (20.2 KB)

The heading in excel(A1 to f1) to be merged

@Sindujaa,

See the following sample code for your reference.

// Open your workbook
Workbook wbk = new Workbook("Book1.xlsx");

// Create a Worksheet and get the first sheet.
Worksheet worksheet = wbk.Worksheets[0];

// Create a Cells object to fetch all the cells.
Cells cells = worksheet.Cells;

// Merge some Cells (A1:F1) into a single A1 Cell.
cells.Merge(0, 0, 1, 6);

// Save the Workbook.
wbk.Save("out1.xlsx");

Also, see the document for your reference.