INNER CODE UNIT · Python
first_cell
fzumstein/python-for-excel · sales_report_openpyxl.py:97
first_cell = sheet.cell(row=startrow + 1, column=startcol + 1)
last_cell = sheet.cell(row=startrow + nrows, column=startcol + ncols)
range_address = f"{first_cell.coordinate}:{last_cell.coordinate}"
sheet.conditional_formatting.add(
range_address,
CellIsRule(
operator="lessThan",
formula=["20000"],
stopIfTrue=True,
font=Font(color="E93423"),
),
)
# Chart
chart = BarChart()
chart.type = "col"
chart.title = "Sales per Month and Store"
chart.height = 11.5