Python Forum
Can you help me to merge the cells with OpenPyXL? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Can you help me to merge the cells with OpenPyXL? (/thread-32269.html)



Can you help me to merge the cells with OpenPyXL? - TurboC - Jan-31-2021

Hi guys,

from the documentation, I already know how to merge cells in Excel, but I need your help because I can't create a kind of table. below an example:

[Image: d1a04b1368591287.jpg]

if I have to add four columns, the result has to be like shown in the image (the merge of the cells depends by the result of the 2**n).

I wrote only the body of the code, but the main part it's difficult to implement. can you help me to write it?

import openpyxl

wb=openpyxl.Workbook()
ws=wb.active
ws.title="TEST"

..
..

wb.save(test.xlsx)



RE: Can you help me to merge the cells with OpenPyXL? - Larz60+ - Feb-01-2021

I suggest that you take a look at some samples
here's a pretty good set: https://www.programcreek.com/python/example/84342/openpyxl
then try again, and ask for help specifically where needed.