Skip to content Skip to sidebar Skip to footer

Delete Cells In Excel Using Python 2.7 And Openpyxl

I'm trying to delete cells from an Excel spreadsheet using openpyxl. It seems like a pretty basic command, but I've looked around and can't find out how to do it. I can set their

Solution 1:

In openpyxl cells are stored individually in a dictionary. This makes aggregate actions like deleting or adding columns or rows difficult as code has to process lots of individual cells. However, even moving to a tabular or matrix implementation is tricky as the coordinates of each cell are stored on each cell meaning that you have process all cells to the right and below an inserted or deleted cell. This is why we have not yet added any convenience methods for this as they could be really, really slow and we don't want the responsibility for that.

Hoping to move towards a matrix implementation in a future version but there's still the problem of cell coordinates to deal with.

Post a Comment for "Delete Cells In Excel Using Python 2.7 And Openpyxl"