Skip to content
Julian Halliwell edited this page Feb 25, 2015 · 6 revisions

Merges a block of cells.

mergeCells( workbook, startRow, endrow, startColumn, endColumn )

##Required arguments

  • workbook spreadsheet object
  • startRow numeric
  • endRow numeric
  • startColumn numeric
  • endColumn numeric

##Note If you merge two cells using this function, the merged cell by default displays the value in the cell that is on the left-hand 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.

##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 );
Clone this wiki locally