Feb-11-2021, 09:31 PM
I made an excel sheet with three merged cells to match your image. Try this:
>>> from openpyxl.cell import MergedCell >>> for cell in ws["A"]: ... print(cell) ... print(cell.value) ... print(isinstance(cell, MergedCell)) ... print('--') ... <Cell 'Sheet1'.A1> None False -- <MergedCell 'Sheet1'.A2> None True -- <MergedCell 'Sheet1'.A3> None True --