from openpyxl import load_workbook
wb = load_workbook("sample2.xlsx")
ws = wb.active

ws.delete_rows(8)               # 8행 삭제
ws.delete_rows(8, 3)            # 8번째 줄부터 총 3줄 삭제
# ws.delete_cols(2)               # B열 삭제
ws.delete_cols(2, 2)              # B, C 열 삭제

wb.save("sample_delete.xlsx")

fb319c3ec1f45590b0812ce4949865b573e736c6
<mask token>

<mask token>
ws.delete_rows(8)
ws.delete_rows(8, 3)
ws.delete_cols(2, 2)
wb.save('sample_delete.xlsx')

<mask token>
wb = load_workbook('sample2.xlsx')
ws = wb.active
ws.delete_rows(8)
ws.delete_rows(8, 3)
ws.delete_cols(2, 2)
wb.save('sample_delete.xlsx')

from openpyxl import load_workbook
wb = load_workbook('sample2.xlsx')
ws = wb.active
ws.delete_rows(8)
ws.delete_rows(8, 3)
ws.delete_cols(2, 2)
wb.save('sample_delete.xlsx')

from openpyxl import load_workbook
wb = load_workbook("sample2.xlsx")
ws = wb.active

ws.delete_rows(8)               # 8행 삭제
ws.delete_rows(8, 3)            # 8번째 줄부터 총 3줄 삭제
# ws.delete_cols(2)               # B열 삭제
ws.delete_cols(2, 2)              # B, C 열 삭제

wb.save("sample_delete.xlsx")
