-
-
Notifications
You must be signed in to change notification settings - Fork 36
addConditionalFormatting
Julian Halliwell edited this page May 2, 2023
·
1 revision
Adds a conditionalFormatting rule object to a workbook.
addConditionalFormatting( workbook, conditionalFormatting )
-
workbook
spreadsheet object -
conditionalFormatting
ConditionalFormatting object: built with newConditionalFormatting()
Chainable? Yes.
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...
;