最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - What is the best way to copy a column's conditional formatting? - Stack Overflow

programmeradmin6浏览0评论

I am generating an Excel report using Python. I have a "template" report that uses conditional formatting for various cells. What is the best way to copy all the formatting from, say, column A (which could be different in different cells/rows) to column D within a given sheet?

(I'm assuming we are using openpyxl but am game to other mac-friendly options)

Basically I want a function that is:

def copy_formatting(openpyxl_sheet, from_col, to_col):
       .... magic happens here ....
       return openpyxl_sheet
发布评论

评论列表(0)

  1. 暂无评论