GetSheet
Returns an object that represents a sheet.
Syntax
expression.GetSheet(nameOrIndex);
expression - A variable that represents a Api class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| nameOrIndex | Required | string | number | Sheet name or sheet index. |
Returns
ApiWorksheet | null
Example
Open a specific sheet by name and write content into one of its cells in a spreadsheet.
// How do I navigate to a particular sheet using its tab name in a spreadsheet?
// Target a named sheet directly and place a value into it without switching tabs in a spreadsheet.
let worksheet = Api.GetSheet("Sheet1");
worksheet.GetRange("A1").SetValue("This is a sample text on 'Sheet1'.");