Search

Update Cells

Last Updated: Sep 13, 2021

Articles

Use this function to update the specified range of cell(s) with the specified value.

Syntax

Update Cells (id_or_url, sheet_name_or_index , rng, value, row_values, 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
rng Cell Range
value Value to be updated
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, Cell value is updated
  • On Failure returns 0, Error Message

Sample

Update Cells (ABC123, Invoice, A1:B1, (1,2), —–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 updates the cells in the range A1:B1 with the values 1, 2.
    Returns Cell value is updated on updating the row.

To view all the Google Sheets functions, click here.

Did you find what you were looking for?