python - Excel 中的条件格式 +1
问题描述
我想将条件格式应用于包含 +1 的所有单元格。为了避免 Excel 将 +1 转换为 1,我使用了 '+1. 但是,下面的代码不起作用。任何想法为什么?
my_formats = {-1: '#FF0000',
"'+1": '#00FF00',}
for val, color in my_formats.items():
fmt = workbook.add_format({'font_color': color})
worksheet.conditional_format('B3:EK500', {'type': 'cell',
'criteria': '=',
'value': val,
'format': fmt})
解决方案
推荐阅读
- javascript - 为什么正则表达式在表单输入上不正确。Javascript
- python - 无法在 Django 中导入 xlsx 编写器
- python-3.x - 工作 xml 数据 - 在 Python 中提取部分字符串
- google-apps-script - Google 脚本创建事件 - 事件描述问题
- javascript - 来自csv的c3 js饼图
- react-native - 使用 aws-amplify-react-native 注册时未收到确认码(之前突然失败的作品)
- php - PHP删除匹配模式或通配符模式的标签
- css - 条纹支付选择样式
- javascript - jQuery - 查找同一父行的另一个子元素值
- c# - MsiTriState LinkToFile和MsiTriState SaveWithDocument是什么意思在添加图片到excel C#