Python解决简单.xlsx文件复制问题

Python解决简单.xlsx文件复制问题
链接: https://pan.baidu.com/s/1yuBbPUSXY8lBZ0tFvE5qmQ?pwd=1234 提取码: 1234 复制这段内容后打开百度网盘手机App,操作更方便哦
具体需求如图[]([](

img

img

img


你这是想找人给你写个程序,还是怎么的?

哇,细节这么多,光发图怕是大家难以理解

这个感觉vba更好一些

希望可以提供一些新思路

import openpyxl

wb = openpyxl.load_workbook("示例.xlsx")
valueWb = openpyxl.load_workbook("示例.xlsx", data_only = True)

for sheet in wb:
    d = [sheet['D'], sheet['L'], sheet['P'], sheet['T']]
    for col in d:
        for cell in col:
            # 如果是公式
            if cell.data_type == 'f':
                cell.value = valueWb[sheet.title].cell(row=cell.row, column=cell.column).value
               
    for i in range(232,44,-4):
        for j in range(ord('E'), ord('U') + 1, 4):
            if sheet[chr(j - 2) + str(i)].value is not None:
                sheet[chr(j) + str(i)].number_format = sheet[chr(j) + str(236)].number_format
                sheet[chr(j) + str(i)].value = sheet[chr(j) + str(236)].value
    
wb.save('示例_修改后.xlsx')

这个数据做逻辑推算能准确么

这个最好自己写,这样对你提升才快
https://blog.csdn.net/yiqian95/article/details/123321555
这篇你可以看看,希望对你有所帮助,有其他问题还可以沟通