excel 合并单元格内容数据写入

you can use this code to open (test.xlsx) file and modify A1 cell and then save it with a new name

import openpyxl
xfile = openpyxl.load_workbook('test.xlsx')

sheet = xfile.get_sheet_by_name('Sheet1')
sheet['A1'] = 'hello world'
xfile.save('text2.xlsx')


实例配置:

import openpyxl
xfile = openpyxl.load_workbook('./7月生产.xlsx')
 
sheet = xfile.get_sheet_by_name('汇总表')
sheet['F11'] = '888.88TB*天'
 
 
xfile.save('新的汇总表.xlsx')

  

posted @   Oops!#  阅读(55)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
历史上的今天:
2017-08-07 整理的linux面试运维题
点击右上角即可分享
微信分享提示