applyxf
Apply a cell style (named or property-pair) to a range.
Syntax
Section titled “Syntax”applyxf(cr, style_name)applyxf(cr, prop1, val1, prop2, val2, ...)Description
Section titled “Description”Applies a cell style to the cells in cr. The style can be:
- A named style from the workbook’s style gallery (e.g.
'Heading 1','Currency') - A set of name-value property pairs for a custom style — properties include
'BackgroundColor','Font','FontSize','Bold','Italic','NumberFormat','HorizontalAlignment', etc.
The abbreviation xf follows the OpenXML “cellXfs” terminology — extended formatting record.
Examples
Section titled “Examples”applyxf(A1:A10, 'Heading 1')applyxf(B2:D10, 'BackgroundColor', '#FFFF99', 'Bold', true)