How do I color-fill in a specific Excel cell using openpyxl?

廉价感情. 提交于 2019-12-04 09:10:58
Leb

What was the PatternFill code that you tried using? Is it something similar to this?

from openpyxl.styles import PatternFill

redFill = PatternFill(start_color='FFEE1111', end_color='FFEE1111', fill_type='solid')

Then to apply to a specific cell use:

ws['A1'].fill = redFill

Or for grading:

fill = PatternFill(fill_type=None, start_color='FFFFFFFF', end_color='FF000000')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!