Reputation: 435
I would like to update 2 columns as on the attached screenshot
I dont have any problems with a single cell
range_attempts = ledger!E35
values = [
[
attempts
],
]
Body = {
'values': values,
}
response = service.spreadsheets().values().update(
spreadsheetId=SAMPLE_SPREADSHEET_ID, range=range_attempts,
valueInputOption='RAW', body=Body).execute()
But find it difficult to use batchUpdate
How could I define a range for 2 columns, given that I am going to set all cells to the same value = 0
SOLUTION
use: 'majorDimension': 'COLUMNS'
range_reset = ledger_name + '!' + "E3:E203"
val = []
for _ in range(200):
val.append("0")
values = [
val,
]
Body = {
'values': values,
'majorDimension': 'COLUMNS'
}
Upvotes: 0
Views: 52
Reputation: 435
use: 'majorDimension': 'COLUMNS'
range_reset = ledger_name + '!' + "E3:E203"
val = []
for _ in range(200):
val.append("0")
values = [
val,
]
Body = {
'values': values,
'majorDimension': 'COLUMNS'
}
Upvotes: 1