Creating conditional formatting rule using variable in python openpyxl ( question to be opened) [cl

preview_player
Показать описание

Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Creating conditional formatting rule using variable in python openpyxl ( question to be opened) [closed]

I have code as below
rule = formatting.Rule(type='expression')
color_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')
#orange_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')

rule = formatting.Rule(type='expression')
color_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')
#orange_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')

Instead of manually searching for text "G" want to assign it text variable and then pass it in the formula
textval = "G"
rule = formatting.Rule(type='expression')
color_fill = styles.PatternFill(start_color='FFA500', end_color='FFA500', fill_type='solid')
#orange_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')

textval = "G"
rule = formatting.Rule(type='expression')
color_fill = styles.PatternFill(start_color='FFA500', end_color='FFA500', fill_type='solid')
#orange_fill = styles.PatternFill(start_color='90EE90', end_color='90EE90', fill_type='solid')

Tags: python,openpyxlSource of the question:

Question and source license information:
Рекомендации по теме
join shbcf.ru