Skip to content

styleRange

On this page

Apply a style to every existing cell in a range.

Mutates ws in place and returns the same worksheet for chaining. When createCells is true, missing cells in the range are created as styled stubs.

styleRange(ws: WorkSheet, range: string | Range, style: CellStyle, opts?: {
    createCells?: boolean;
}): WorkSheet

Parameters

NameTypeRequired
wsWorkSheetYes
rangestring | RangeYes
styleCellStyleYes
opts{ createCells?: boolean }No

Returns

WorkSheet