Skip to content

Initial Selection

The initialSelection prop sets which cell or range is selected when the editor first renders. The editor will also scroll to make that selection visible.

Pass an A1-style reference string:

// Single cell
<SpreadsheetEditor model={model} initialSelection="A1" />
// Range
<SpreadsheetEditor model={model} initialSelection="B5:D10" />
// Cell on a sheet with spaces in its name
<SpreadsheetEditor model={model} initialSelection="'Sales Dashboard'!F16" />

Opening at a specific data range — if you know your data starts at a particular cell, land the user there instead of A1:

<SpreadsheetEditor model={model} initialSelection="A3" />