format_excel_cells
Apply formatting to Excel cell ranges: adjust font, colors, borders, alignment, and number format while preserving existing styling.
Instructions
Apply formatting to a cell range: font, colors, borders, alignment, number format.
Only the attributes you pass are changed; existing styling is preserved. Example — style a header row: cell_range="A1:D1", bold=true, font_color="FFFFFF", fill_color="4472C4", horizontal_align="center", border_style="thin".
@param file_path: Absolute path to the .xlsx/.xlsm file. @param cell_range: Range like "A1:C10" or a single cell like "B2". @param sheet_name: Target sheet. None = first sheet. @param font_name: Font family (e.g. "Calibri"). @param font_size: Font size in points. @param bold: Bold on/off. @param italic: Italic on/off. @param font_color: Text color, RRGGBB hex (e.g. "FFFFFF"). @param fill_color: Background color, RRGGBB hex (e.g. "4472C4"). @param border_style: thin, medium, thick, double, dashed, or dotted. @param border_edges: "all" = every cell; "outline" = outer edge of range only. @param horizontal_align: left, center, right, or justify. @param vertical_align: top, center, or bottom. @param wrap_text: Enable/disable text wrapping. @param number_format: Excel format code (e.g. "#,##0.00", "dd/mm/yyyy", "0%"). @return: Confirmation with the number of cells formatted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bold | No | ||
| italic | No | ||
| file_path | Yes | ||
| font_name | No | ||
| font_size | No | ||
| wrap_text | No | ||
| cell_range | Yes | ||
| fill_color | No | ||
| font_color | No | ||
| sheet_name | No | ||
| border_edges | No | all | |
| border_style | No | ||
| number_format | No | ||
| vertical_align | No | ||
| horizontal_align | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |