Format cells
xlide_format_cellsApply bold, fonts, fills, borders, alignment, number formats and merging to Excel cell ranges while preserving each cell's other formatting.
Instructions
Changes how a range looks: bold and font, fill colour, borders, alignment, number format, and merging. Only what you pass is changed, so each cell keeps the rest of its own format and making a header row bold does not flatten the number formats under it. Colours are RRGGBB or AARRGGBB hex without a leading hash. A number format is an Excel format code such as '#,##0.00' or 'yyyy-mm-dd'; that code is also what decides whether a number is shown as a date. Merging clears values and formulas outside the top-left cell; allow_overwrite is required when that would discard content. Works on .xlsx, .xlsm and .xlam.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bold | No | Bold on or off. | |
| merge | No | 'merge' joins the range into one cell, keeping only the top-left value. 'unmerge' splits it back. Empty leaves merging alone. | |
| sheet | Yes | Worksheet name, matched without case. | |
| style | No | A named cell style, applied first: one of Excel's own, such as Good, Bad, Neutral, Title, Heading 1, Total, Input, Output, Note or 20% - Accent1, or one the workbook defines. It sets only the parts the style includes. | |
| italic | No | Italic on or off. | |
| strike | No | Strikethrough on or off. | |
| vertical | No | top, center, bottom, justify or distributed. | |
| file_path | Yes | Absolute path to the Excel file. | |
| font_name | No | Typeface, such as 'Calibri'. | |
| font_size | No | Points. 0 leaves it alone. | |
| underline | No | Single underline on or off. | |
| wrap_text | No | Wrap text in the cell. | |
| cell_range | Yes | A1-style range, such as A1:D1, or a single cell. | |
| fill_color | No | Solid background colour as hex. 'none' clears the fill back to no fill. | |
| font_color | No | Text colour as hex, such as 'FF0000'. | |
| horizontal | No | left, center, right, fill, justify or general. | |
| border_color | No | Border colour as hex. Defaults to automatic. | |
| border_style | No | Border on all four sides: thin, medium, thick, double, dotted, dashed, hair, or none to remove. | |
| number_format | No | Excel format code, such as '#,##0.00', '0%' or 'yyyy-mm-dd'. | |
| allow_overwrite | No | For merge: allow clearing values or formulas in cells other than the top-left cell. Ask the user first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||