Get used range
Find the block of cells on a sheet that holds values, with its last row and column.
Command in the Microsoft 365 toolkit · id ooa.microsoft365/excel_used_range · 5 inputs, 5 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Access token | Credential | No | Microsoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Remote path | String | No | Workbook path in the drive (e.g. Finance/budget.xlsx), or id:{item-id}. | |
| Sheet | String | No | Worksheet name. | |
| Drive | String | No | me/drive | Whose files: me/drive (your OneDrive), a person (ann@acme.com), a SharePoint site (contoso.sharepoint.com:/sites/Finance), a library of a site by name (contoso.sharepoint.com:/sites/Finance:/Invoices), or sites/{site-id}/drive or drives/{drive-id}. With an app sign-in, name a person or site. |
| Endpoint address | String | No | https://graph.microsoft.com/v1.0 | Graph endpoint; change only for national clouds or testing. |
Outputs
| Output | Type | What it is |
|---|---|---|
| address | String | Used range, e.g. A1:F42; empty for an empty sheet. |
| row_count | Number | Rows in the used range. |
| column_count | Number | Columns in the used range. |
| last_row | Number | Sheet row number of the last used row (0 when empty). |
| last_column | String | Letter of the last used column. |