Hello,
I am relatively new to coding. I want to automate one of the reports i run at work since it takes about 10-15 minute of my time a day
I am getting undefined name 'Rule' error when i type in the highlighted in to my IDE. Essentially what im trying to do is if the cell
in COL D has the word 'PEFI' highlight that COL orange.
#format for LDC Status to highlight accounts going final
orange_fill = PatternFill(bgColor='ffbb4f')
black_text = Font(color='000000')
dxf = DifferentialStyle(font=black_text, fill=OrangeFill)
rule = Rule(type='containsText',operator='containsText', text='PEFI',dxf=dxf)
rule.formula = ['NOT(ISERRROR(SEARCH("PEFI",D1)))']
ws.conditional_formatting.add('D:D',rule)
Please let me know why im getting this error. Im basing my formatting off the example on the conditional formatting examples given on the webpage.
also if anyone has an example where i can mirror the conditional formatting for finding text it would be greatly appreciated!
Thanks
Ryan