Skip to content

addConditionalFormatting

Julian Halliwell edited this page May 2, 2023 · 1 revision

Adds a conditionalFormatting rule object to a workbook.

addConditionalFormatting( workbook, conditionalFormatting )

Required arguments

Chainable? Yes.

Examples

formatting = spreadsheet.newConditionalFormatting()
  .onCells( "A1:B1" )
  .whenCellValueIs( "GT", 100 )
  .setFormat( { fontColor: "GREEN" } );
wb = spreadsheet.newXlsx();
spreadsheet.addConditionalFormatting( wb, formatting );
formatting = spreadsheet.newConditionalFormatting()
  .onCells( "A1:B1" )
  .when( "$A1<0" )
  .setFormat( { fontColor: "RED" } );
spreadsheet.newChainable( "xlsx" )
  .addConditionalFormatting( formatting )
  //more chained calls...
;
Clone this wiki locally