我正在尝试用 python 更新我的谷歌电子表格。不幸的是,我的代码总是更新左侧的一列/单元格。
我的代码:
headers = wks2.row_values(7)
colToUpdate = headers.index("12.11.")
#find the char
cellLookup = wks2.find('Gul')
# get the cell to be updated
cellToUpdate = wks2.cell(cellLookup.row, colToUpdate)
# update the cell's value
cellToUpdate.value = 3
# put it in the queue
cell_list.append(cellToUpdate)
# now, do it
wks2.update_cells(cell_list)
print(cell_list)输出 [<Cell R8C6 3>] 但它应该是/它希望它是 R8C7。
我可以改变他从 1 开始计数或者只是添加 +1 或类似的东西吗?
我添加了电子表格的图像。
慕仙森
相关分类