Search

Delete Column

Last Updated: Mar 15, 2021

Articles

Use this function to delete the columns with the provided index range from the worksheet.

Syntax

Delete Column (id_or_url, sheet_name_or_index , start_index, end_index, private_key, cient_email)

Parameters

Input Parameter Name Description
id_or_url ID or URL of Google Sheet
sheet_name_or_index Name or index of worksheet
start_index Start index of a column
end_index End index of a column
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, Selected columns deleted successfully
  • On Failure returns 0, Error Message

Sample

Delete Column (ABC123, Invoice, 1, 5, —–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 sheet Invoice using the ID ABC123 and deletes the columns 1 to 5.
    Returns Selected columns deleted successfully on deleting the columns.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?