I have Excel file out_file
and DataFrame dfSave
.
I want this DataFrame to append Excel starting from column D.
I think sometimes in this file can appear some formatting like bgcolor or “Wrap text”, hope this doesn’t affect, cause openpyxl starts to append only from “virgin” rows.
This is what I have now, but like I said, I want it to start at column D and after rows that filled in, ignoring formatting.
wb = load_workbook(filename=out_file)
ws = wb["Sheet 1"]
for r in dataframe_to_rows(dfSave, index=False, header=False):
ws.append(r)
wb.save(out_file)
Image of the initial state of the table
Image of the final state of the table
Сергей is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.