format_range
Apply formatting to a range of cells in an Excel worksheet. Supports bold, italic, colors, borders, number format, alignment, text wrapping, merge, protection, and conditional formatting.
Instructions
Apply formatting to a range of cells.
Args:
sheet_name: Name of worksheet
start_cell: Starting cell
session_id: Session ID from open_workbook (preferred)
filepath: Path to Excel file (legacy, deprecated)
end_cell: Ending cell (optional)
bold: Apply bold formatting
italic: Apply italic formatting
underline: Apply underline formatting
font_size: Font size
font_color: Font color
bg_color: Background color
border_style: Border style
border_color: Border color
number_format: Number format
alignment: Text alignment
wrap_text: Enable text wrapping
merge_cells: Merge cells in range
protection: Cell protection settings (optional)
conditional_format: Conditional formatting settings (optional)
Note: Use session_id for better performance. filepath parameter is deprecated.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet_name | Yes | ||
| start_cell | Yes | ||
| session_id | No | ||
| filepath | No | ||
| end_cell | No | ||
| bold | No | ||
| italic | No | ||
| underline | No | ||
| font_size | No | ||
| font_color | No | ||
| bg_color | No | ||
| border_style | No | ||
| border_color | No | ||
| number_format | No | ||
| alignment | No | ||
| wrap_text | No | ||
| merge_cells | No | ||
| protection | No | ||
| conditional_format | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |