Skip to content
Julian Halliwell edited this page Mar 3, 2023 · 8 revisions

Formats/styles the contents of multiple cells.

formatCellRange( workbook, format, startRow, endRow, startColumn, endColumn[, overwriteCurrentStyle [, cellStyle  ] ] )

Required arguments

  • workbook spreadsheet object
  • format struct OR cellStyle object: See Formatting options for details. Optional if cellStyle supplied.
  • startRow numeric
  • endRow numeric
  • startColumn numeric
  • endColumn numeric

Optional arguments

  • overwriteCurrentStyle boolean default=true: for performance/efficiency reasons all of the existing styles will be completely overwritten when using this method. To preserve existing formatting properties other than the ones being changed, set this flag to false, but please note that this should only be used when formatting a limited number of cells (you may run into errors if applied to too many cells).

Chainable? Yes.

Example

data = QueryNew( "First,Last","VarChar,VarChar",[ [ "Susi","Sorglos" ],[ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
workbook = spreadsheet.workbookFromQuery( data );
spreadsheet.formatCellRange( workbook,{bold="true"},1,1,2,2 );
Clone this wiki locally