from openpyxl import load_workbook
wb = load_workbook("C:\op.xlsx")
ws = wb.active
This is the code I have so far as I don't know what to do next so pls help me.
Try:
ws.delete_rows(1, ws.max_row)
You could also delete the sheet and create another one:
del wb[wb.active.title]
wb.create_sheet()
See
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.