Python Forum

Full Version: Can you help me to merge the cells with OpenPyXL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
I suggest that you take a look at some samples
here's a pretty good set: https://www.programcreek.com/python/exam...2/openpyxl
then try again, and ask for help specifically where needed.