Search

Create Worksheet

Last Updated: Feb 14, 2022

Articles

Use this function to create a new worksheet in a Google Sheet with the given row-column count.

Syntax

Create Worksheet (id_or_url, sheet_name , row_count, col_count, private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of the Google Sheet
sheet_name Name of worksheet
row_count Number of rows to be generated in a worksheet
col_count Number of columns to be generated in a worksheet
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, Sheet Name is created successfully
  • On Failure returns 0, Error Message

Sample

Create Worksheet (ABC123, Invoice, 3, 4, —–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, creates the sheet Invoice using the ID ABC123 with 3 rows and 4 columns.
    Returns Invoice is created successfully on creating the worksheet.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?