# SpreadsheetFormatCellRange

Formats a range of cells in a spreadsheet with a single format struct.

## Method Signature

```
SpreadsheetFormatCellRange(spreadsheetObj=[any], format=[any], startRow=[any], startColumn=[any], endRow=[any], endColumn=[any])
```

### Arguments

| Argument         | Type      | Required | Description                                                                   | Default |
| ---------------- | --------- | -------- | ----------------------------------------------------------------------------- | ------- |
| `spreadsheetObj` | `ANY`     | `true`   | The spreadsheet object.                                                       |         |
| `format`         | `STRUCT`  | `true`   | The format struct containing style properties (alignment, bold, color, etc.). |         |
| `startRow`       | `NUMERIC` | `true`   | The starting row number (1-based).                                            |         |
| `startColumn`    | `NUMERIC` | `true`   | The starting column number (1-based).                                         |         |
| `endRow`         | `NUMERIC` | `true`   | The ending row number (1-based).                                              |         |
| `endColumn`      | `NUMERIC` | `true`   | The ending column number (1-based).                                           |         |

## Examples

Format a range of cells:

```js
// Format cells A1:C3
var spreadsheet = SpreadsheetNew();
SpreadsheetAddRows( spreadsheet, [ ["A", "B", "C"], ["1", "2", "3"], ["X", "Y", "Z"] ] );

var format = { bold = true, background = "FFFF00", alignment = "center" };
SpreadsheetFormatCellRange( spreadsheet, 1, 1, 3, 3, format );
```

Style table headers:

```js
// Format header row
var spreadsheet = SpreadsheetNew();
SpreadsheetAddRow( spreadsheet, [ "Name", "Email", "Phone" ] );
SpreadsheetAddRow( spreadsheet, [ "John", "john@example.com", "555-1234" ] );

var headerFormat = { bold = true, color = "FFFFFF", background = "000000" };
SpreadsheetFormatCellRange( spreadsheet, 1, 1, 1, 3, headerFormat );
```

## Related

* [SpreadsheetFormatCell()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatcell.md) - Format single cell
* [SpreadsheetFormatRow()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatrow.md) - Format entire row
* [SpreadsheetFormatColumn()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatcolumn.md) - Format entire column


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatcellrange.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
