Copy worksheet
Copy a worksheet's cells (values, formulas and number formats) into a new worksheet, in the same workbook or another one, with its column widths, row heights, fonts, fill colours and alignment.
Command in the Microsoft 365 toolkit · id ooa.microsoft365/excel_copy_worksheet · 8 inputs, 2 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 to copy. | |
| Target remote path | String | No | Workbook to copy into (path in the same drive, or id:{item-id}); the same workbook when empty. | |
| New name | String | No | Name of the new worksheet; the source sheet's name when empty, which must then be free in the target workbook. | |
| 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. |
| Copy formats | String | No | all | all copies column widths, row heights, fonts, fill colours and alignment; sizes only widths and heights; none only cells and number formats (fastest). |
Outputs
| Output | Type | What it is |
|---|---|---|
| sheet_name | String | Name of the new worksheet. |
| address | String | Cells written on the new worksheet, e.g. A1:F42; empty when the source sheet is empty. |