I have to write data in an excel sheet that contains merged cells, but I don't know how to do it because I can't identify the merged cells. For example, if I read all the cells in the first column of the sheet shown below, I read all of them, even if some of them belong to some merged cells:
Here I can read four cells, but all of them are merged! I need to identify the main one not all of them. How can I iterate through all the "right" cells in a column? I have to identify the merged cells and write on them!
>>> wb = openpyxl.load_workbook('test.xlsx') >>> ws = wb['TEST'] >>> >>> for cell in ws["A"]: ... print(cell.value) ... None None None None >>>[Image: 8a2ac11369689167]
Here I can read four cells, but all of them are merged! I need to identify the main one not all of them. How can I iterate through all the "right" cells in a column? I have to identify the merged cells and write on them!