As there is no specific information provided on the source and destination files and which cell to pick data and put into which cell, I am providing a generic solution. You can use this and identify source and destination cells to copy-paste values. There will be no change to the destination file, except for the values being overwritten. The style, etc. will remain as is. Hope this helps.
import openpyxl
wbsource = load_workbook('inputfile.xlsx') #Open source excel from which you want to copy
wssource = wbsource['Sheet4'] #Pick sheet you want to get the data from
wbdest = load_workbook('output.xlsx') #Open destination excel into which you want to paste
wsdest = wbdest['Sheet1'] #Pick sheet you want to paste the data to
wsdest.cell(row=11, column=1).value = wssource.cell(row=3, column = 1).value #Take "value" from source cell A3 and paste to dextination cell A11
# Put your other source and destination cells here
# ...
wbdest.save('output.xlsx') #Finally save the file
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.