> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetsetcellvalue.md).

# SpreadsheetSetCellValue

Specifies the value of an Excel spreadsheet object cell.

## Method Signature

```
SpreadsheetSetCellValue(spreadsheetObj=[any], value=[any], row=[any], column=[any])
```

### Arguments

| Argument         | Type      | Required | Description                   | Default |
| ---------------- | --------- | -------- | ----------------------------- | ------- |
| `spreadsheetObj` | `ANY`     | `true`   | The spreadsheet object.       |         |
| `value`          | `ANY`     | `true`   | The value to set in the cell. |         |
| `row`            | `NUMERIC` | `true`   | The row number (1-based).     |         |
| `value`          | `ANY`     | `true`   | The value to set in the cell. |         |

## Examples

Set a simple cell value:

```js
// Write a value to a cell
var spreadsheet = SpreadsheetNew();
SpreadsheetSetCellValue( spreadsheet, 1, 1, "Hello" );
SpreadsheetSetCellValue( spreadsheet, 1, 2, 42 );
SpreadsheetSetCellValue( spreadsheet, 1, 3, true );
```

Build a data table:

```js
// Create a structured table
var spreadsheet = SpreadsheetNew();

// Headers
SpreadsheetSetCellValue( spreadsheet, 1, 1, "Name" );
SpreadsheetSetCellValue( spreadsheet, 1, 2, "Age" );
SpreadsheetSetCellValue( spreadsheet, 1, 3, "Email" );

// Data rows
SpreadsheetSetCellValue( spreadsheet, 2, 1, "Alice" );
SpreadsheetSetCellValue( spreadsheet, 2, 2, 28 );
SpreadsheetSetCellValue( spreadsheet, 2, 3, "alice@example.com" );
```

Update existing cells:

```js
// Modify spreadsheet data
var spreadsheet = SpreadsheetRead( "/path/to/file.xlsx" );

// Update pricing information
SpreadsheetSetCellValue( spreadsheet, 5, 3, 99.99 );
SpreadsheetSetCellValue( spreadsheet, 6, 3, 149.99 );

SpreadsheetWrite( spreadsheet, "/path/to/updated.xlsx" );
```

## Related

* [SpreadsheetGetCellValue()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetgetcellvalue.md) - Read cell values
* [SpreadsheetClearCell()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetclearcell.md) - Clear cell contents
* [SpreadsheetSetCellFormula()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetsetcellformula.md) - Set cell formulas
* [SpreadsheetFormatCell()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatcell.md) - Format cells
* [Cell Operations Guide](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/cell-operations.md) - Working with cells


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/spreadsheetsetcellvalue.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.
