我正在使用 CellIs 类型的 openpyxl conditonal_formatting,所以我可以这样做:rule = openpyxl.formatting.rule.CellIsRule(operator='lessThan', formula=['3'], fill=fill)但我似乎不能做任何除了常数之外的公式......如果我尝试输入'Q1',它永远不会做任何事情......
1 回答

三国纷争
TA贡献1804条经验 获得超7个赞
什么是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))
前:
后:
添加回答
举报
0/150
提交
取消