基于单元格的openpyxl条件格式

我正在使用 CellIs 类型的 openpyxl conditonal_formatting,所以我可以这样做:

rule = openpyxl.formatting.rule.CellIsRule(operator='lessThan', formula=['3'], fill=fill)

但我似乎不能做任何除了常数之外的公式......如果我尝试输入'Q1',它永远不会做任何事情......


12345678_0001
浏览 374回答 1
1回答

三国纷争

什么是fill定义?这对我来说很好用:red_fill = PatternFill(start_color='EE1111', end_color='EE1111', fill_type='solid')ws.conditional_formatting.add('B1:B5', CellIsRule(operator='greaterThan',                                                  formula=['B3'], fill=red_fill))前:后:
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python