import os import xlwings as xw app = xw.App(visible = True, add_book = False) wb = app.books.open('C:\\Users\\Administrator\\Desktop\\测试\\测试.xlsx') ws = wb.sheets[0] wc = ws.range('A7').expand('table').value print(wc) new_wb = xw.Book('C:\\Users\\Administrator\\Desktop\\测试\\统计表.xlsx') new_sh = new_wb.sheets[0] scope = new_sh.range('A1').expand() new_sh.range(scope.shape[0]+1,1).value = wc print(scope) new_wb.save() new_wb.close() wb.close() app.quit()
跨表复制粘贴(往下粘贴)每日一练
最新推荐文章于 2024-05-14 11:00:23 发布