Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xlwings: Delete a col | row from Excel

How do I delete a row in Excel?

wb = xw.Book('Shipment.xlsx')
wb.sheets['Page1_1'].range('1:1').clear()

.clear() works to remove the content. I want to delete the row. I'm surprise the .clear() function works, but not .delete()

Any advice helps! Thank you

like image 689
NinjaWarrior Avatar asked Oct 24 '25 09:10

NinjaWarrior


1 Answers

It is now possible to delete without using api property:

wb.sheets['Page1_1'].range('1:1').delete()
like image 82
Andrey Avatar answered Oct 26 '25 05:10

Andrey