how to delete every row in excel using openpyxl

Solutions on MaxInterview for how to delete every row in excel using openpyxl by the best coders in the world

showing results for - "how to delete every row in excel using openpyxl"
Tania
29 Oct 2018
1import openpyxl as xl
2wb = xl.load_workbook()
3ws = wb.active
4ws.delete_rows(firstrow, numberofrows) #for multiple row deletion
5ws.delete_rows(1, ws.max_row+1) # for entire sheet
6ws.delete_rows(rownum) #for single row