Search code examples
pythonxlsx

Delete all hidden rows using python


There are some hidden rows in my xlsx file. I want to remove them using python. Is there any python solution? Sheet


Solution

  • You can make use of openpyxl library in python. The workbook loaded via this library has a hidden property available in the Row Dimension of the workbook (https://openpyxl.readthedocs.io/en/stable/_modules/openpyxl/worksheet/dimensions.html?highlight=hidden)

    You can iterate over the rows and exclude rows which have hidden property set to true and create a new excel with the non-hidden rows.