Search

Rename Worksheet

Last Updated: Mar 15, 2021

Articles

Use this function to rename a worksheet in the Google Sheet.

Syntax

Rename Worksheet (id_or_url, sheet_name_or_index , new_sheetname, private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of the Google Sheet
sheet_name_or_index Name or index of worksheet
new_sheetname New name of the Gsheet
private_key Private key of the service account
client_email Email ID of the service account

Returns

Return Value Description
Output
  • On Success returns 1, Worksheet has been renamed successfully
  • On Failure returns 0, Error Message

Sample

Rename Worksheet (ABC123, Invoice, Travel_Invoice, —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—–, name@project-id.iam.gserviceaccount.com)

  • Uses the private key —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—– to connect to the Email ID name@project-id.iam.gserviceaccount.com, accesses the worksheet Invoice using the ID ABC123 and renames it to Travel_Invoice.
    Returns Worksheet has been renamed successfully on renaming the worksheet.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?