import os
import xlwings as xw
files_path = r'C:/Users/Peter Pro/Desktop/zh'
app =
xw.App(visible=True, add_book=False)
app.display_alerts = False
app.screen_updating = False
A=['D14','E14','F14','G14','H14','I14','J14','K14','L14','M14']
B=['D15','E15','F15','G15','H15','I15','J15','K15','L15','M15']
C=['D13','E13','F13','G13','H13','I13','J13','K13','L13','M13']
D=['C15','D15','E15','F15','G15','H15','I15','J15','K15','L15']
for files_path_0, dirs, files in os.walk(files_path):
for file in files:
wb = app.books.open(files_path+'/'+file)
sht = wb.sheets['测算表']
for i in range(9):
sht.range(A[i]).formula = '='+C[i]+'/1.01'
sht.range(B[i]).formula = '=IF('+A[i]+'<=100000,'+A[i]+'*1.01,IF('+A[i]+'>100000,'+A[i]+'))+'+D[i]
wb.save()
wb.close()
app.quit()
app.kill()
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/677456
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.