To update a range of cells, you use the following command.
## Select a range
cell_list = worksheet.range(\'A1:A7\')
for cell in cell_list:
cell.value =
Assuming a table with a header row, as follows:
Name | Weight
------+-------
Apple | 56
Pear | 23
Leaf | 88
Then, the following should be self explanatory
cell_list = []
# get the headers from row #1
headers = worksheet.row_values(1)
# find the column "Weight", we will remember this column #
colToUpdate = headers.index('Weight')
# task 1 of 2
cellLookup = worksheet.find('Leaf')
# get the cell to be updated
cellToUpdate = worksheet.cell(cellLookup.row, colToUpdate)
# update the cell's value
cellToUpdate.value = 77
# put it in the queue
cell_list.append(cellToUpdate)
# task 2 of 2
cellLookup = worksheet.find('Pear')
# get the cell to be updated
cellToUpdate = worksheet.cell(cellLookup.row, colToUpdate)
# update the cell's value
cellToUpdate.value = 28
# put it in the queue
cell_list.append(cellToUpdate)
# now, do it
worksheet.update_cells(cell_list)