Delete Cell in openpyxl

Viewed 35

openpyxl offers the ability to delete a column or a row.

ws.delete_cols(index)
ws.delte_row(index)

Is there a possible way to delete a specific cell?

    for row in ws.iter_rows():
            for cell in row:
                 print(cell.coordinate)

There i want to delete the specific cell.

The Problem is, the two functions are integers and the cell is a string "A1" for example

1 Answers

You cannot delete an individual cell.

But you can remove the contents by setting its value to None:

cell.value=None
Related