-
-
Notifications
You must be signed in to change notification settings - Fork 41
mergeCells
Julian Halliwell edited this page May 29, 2015
·
6 revisions
Merges a block of cells.
mergeCells( workbook, startRow, endrow, startColumn, endColumn )
##Required arguments
-
workbookspreadsheet object -
startRownumeric -
endRownumeric -
startColumnnumeric -
endColumnnumeric -
emptyInvisibleCellsboolean default=false: Whether to set the invisible merged cells to an empty string instead of keeping the original value.
##Note The merged cell by default displays the value in the cell that is on the left-most and top-most side of the spreadsheet. For example, if you merge the cell (20,3) and cell (20,4), then the value in the cell (20,3) is displayed. If the cell (20,3) is blank, then after merging, the cell displays blank.
The other merged cells will retain their original values in the underlying workbook, unless you use the emptyInvisibleCells option.
##Example
data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.workbookFromQuery( data );
// merge rows 2 and 3 of column 1
spreadsheet.mergeCells( workbook,2,3,1,1 );