FormulaRule ( formula =, font = myFont, border = myBorder, fill = redFill )) > # Highlight cells that contain particular text by using a special formula > red_text = Font ( color = "9C0006" ) > red_fill = PatternFill ( bgColor = "FFC7CE" ) > dxf = DifferentialStyle ( font = red_text, fill = red_fill ) > rule = Rule ( type = "containsText", operator = "containsText", text = "highlight", dxf = dxf ) > rule. FormulaRule ( formula =, stopIfTrue = True, fill = redFill )) > # Aside from the 2-color and 3-color scales, format rules take fonts, borders and fills for styling: > myFont = Font () > myBorder = Border () > ws. CellIsRule ( operator = 'between', formula =, stopIfTrue = True, fill = redFill )) > # Format using a formula > ws. CellIsRule ( operator = 'lessThan', formula =, stopIfTrue = True, fill = redFill )) > # Format if cell is between 'formula' > ws. ) > # Add a conditional formatting based on a cell comparison > # addCellIs(range_string, operator, formula, stopIfTrue, wb, font, border, fill) > # Format if cell is less than 'formula' > ws. end_type = 'percentile', end_value = 90, end_color = '00AA00' ). mid_type = 'percentile', mid_value = 50, mid_color = '0000AA'. Condition 1: Cell value is and select duplicate from the dropdown Apply Style: Select your cell style (e.g.
![openoffice conditional formatting duplicates openoffice conditional formatting duplicates](https://s3.manualzz.com/store/data/036761572_1-e948e6b4253411b7554041bddf9a8a76-360x466.png)
An easy way to set up the required styles is to format a cell the way you want it and click the New Style from Selection icon in the Styles and Formatting window. If you are not familiar with styles, please refer to Chapter 4. ColorScaleRule ( start_type = 'percentile', start_value = 10, start_color = 'AA0000'. Conditional formatting depends upon the use of styles.
![openoffice conditional formatting duplicates openoffice conditional formatting duplicates](https://i.stack.imgur.com/h7peV.jpg)
ColorScaleRule ( start_type = 'min', start_color = 'AA0000'. fill_type = 'solid' ) > # Add a two-color scale > # Takes colors in excel 'RRGGBB' style. active > # Create fill > redFill = PatternFill ( start_color = 'EE1111'. In the box next to values with, pick the formatting you want to apply to the duplicate values, and then click OK. from openpyxl import Workbook > from openpyxl.styles import Color, PatternFill, Font, Border > from import DifferentialStyle > from import ColorScaleRule, CellIsRule, FormulaRule > wb = Workbook () > ws = wb. Click Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.