gpt4 book ai didi

python-3.x - 根据行号和列号通过xlwings将值放入Excel单元格

转载 作者:行者123 更新时间:2023-12-01 21:35:38 27 4
gpt4 key购买 nike

假设我想放置值 123进入 Excel 单元格 A2对应于 row=1 , column=2 .我如何通过 xlwings 做到这一点?

我正在使用 xlwings 0.19.4、python 3.7、Excel 2016。

最佳答案

我会回答我自己的问题。

wb = xw.Book.caller()
sheet = wb.sheets[0]
row_num = 1
col_num = 2
sheet.range(row_num, col_num).value = 123

关于python-3.x - 根据行号和列号通过xlwings将值放入Excel单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61999255/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com