mergeCells

fun mergeCells(firstRow: Int, lastRow: Int, firstCol: Int, lastCol: Int)

Merges a range of cells within this sheet.

Memory Caution: Merged region metadata is stored in memory until the workbook is finished. Excessive merging (e.g., thousands of regions) can lead to OutOfMemoryError, especially with Apache POI. For high-frequency merging, consider using FastExcel or increasing heap size.

Streaming Constraint: Both [firstRow] and [lastRow] must be within the current memory window (not yet flushed to disk).

Parameters

firstRow

zero-based index of the first row

lastRow

zero-based index of the last row

firstCol

zero-based index of the first column

lastCol

zero-based index of the last column