[{"data":1,"prerenderedAt":206},["ShallowReactive",2],{"topic:cell-styling":3},[4,13,18,24,31,39,44,49,55,61,67,72,77,82,87,92,97,102,108,113,118,123,128,133,138,143,148,153,158,164,170,175,180,185,190,196,201],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fgenerate-a-staff-rota-in-excel-with-python","Generate a Staff Rota in Excel with Python","Build a weekly shift rota automatically from staff availability and cover requirements: model it as a small optimisation with SciPy's milp solver, enforce one shift a day, contracted maximums, no late-then-early turnarounds and fair weekends, respect shift preferences, then write a colour-coded Excel rota with live coverage checks and verify every rule.","how-to",[10,11],"report-layouts","cell-styling",null,{"path":14,"title":15,"description":16,"type":8,"topics":17,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-multi-sheet-excel-dashboards\u002Fadd-a-table-of-contents-sheet-with-hyperlinks-in-excel","Add a Table of Contents Sheet with Hyperlinks in Excel","Give a multi-sheet workbook a front door — an index sheet with internal hyperlinks, row counts and back-links, generated from whatever sheets the workbook happens to contain.",[10,11],{"path":19,"title":20,"description":21,"type":8,"topics":22,"kind":12},"\u002Fautomating-reporting-workflows\u002Fexporting-excel-reports-to-pdf\u002Ffit-an-excel-sheet-to-one-page-in-pdf","Fit an Excel Sheet to One Page Wide When Exporting to PDF","Stop wide Excel reports from spilling columns onto extra PDF pages — set fit-to-width with openpyxl, predict how small the text will get before converting, and when it gets too small, use landscape, narrower margins, hidden helper columns or a two-page-wide layout with repeated labels. Every layout measured in a LibreOffice PDF export.",[23,11],"pdf-export",{"path":25,"title":26,"description":27,"type":28,"topics":29,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python","Formatting and Charting Excel Reports with Python","Turn plain pandas output into branded, stakeholder-ready Excel reports: cell styling, number and date formats, charts, and embedded logos with openpyxl.","overview",[11,30],"charts-and-images",{"path":32,"title":33,"description":34,"type":35,"topics":36,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fbuilding-excel-reports-with-xlsxwriter","Building Excel Reports with xlsxwriter","The write-only engine that formats fastest: reusable format objects, column-level formatting, charts, conditional formats, panes and constant-memory mode — and exactly when openpyxl is still the right choice.","guide",[37,38,11],"xlsxwriter","writing-excel",{"path":40,"title":41,"description":42,"type":8,"topics":43,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fbuilding-excel-reports-with-xlsxwriter\u002Fwrite-a-formatted-excel-report-with-xlsxwriter","Write a Formatted Excel Report with xlsxwriter","Build a complete styled report in one pass: a title block, a header row you control, column formats and widths, a totals row, banded rows, an autofilter and frozen panes.",[38,37,11],{"path":45,"title":46,"description":47,"type":8,"topics":48,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fbuilding-excel-reports-with-xlsxwriter\u002Fwrite-rich-text-in-a-cell-with-xlsxwriter","Write Rich Text with Mixed Formats in One Cell with xlsxwriter","Put bold labels, coloured status words, superscripts and line breaks inside a single Excel cell with xlsxwriter's write_rich_string — the argument order, the silent return codes when a string is rejected, combining with pandas output, and keeping rich text intact when openpyxl edits the file later.",[11,37],{"path":50,"title":51,"description":52,"type":8,"topics":53,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fcreating-excel-tables-and-autofilters-with-python\u002Fchoose-and-customise-excel-table-styles-with-python","Choose and Customise Excel Table Styles with Python","Pick the right look for an Excel table from Python: the 60 built-in styles and how their names work, the four banding and emphasis switches, styles in openpyxl and XlsxWriter, a custom company table style written with openpyxl, why typos in style names pass silently, and why LibreOffice and PDF conversions show tables unstyled unless you add direct formatting.",[54,11],"tables-and-filters",{"path":56,"title":57,"description":58,"type":35,"topics":59,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl","Styling Excel Cells with openpyxl","Style Excel cells from Python with openpyxl: Font, PatternFill, Border, Alignment, header rows in a loop, merged titles, and reusable NamedStyles — all runnable.",[11,60],"openpyxl",{"path":62,"title":63,"description":64,"type":8,"topics":65,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fadd-alternating-row-colors-with-openpyxl","Add Alternating Row Colors with openpyxl","Band the rows of an Excel report so long lists are easy to follow — with static fills, a MOD(ROW()) conditional format that survives sorting, a SUBTOTAL-based rule that keeps alternating when rows are filtered, table stripes, and banding by group instead of by row.",[11,66,60],"conditional-formatting",{"path":68,"title":69,"description":70,"type":8,"topics":71,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fadd-borders-to-a-range-with-openpyxl","Add Borders to a Range with openpyxl","openpyxl sets borders per cell, and every assignment replaces the whole border. Build helpers that draw a light grid, an outline around a table, a heavy line under the header and a double line above totals — without wiping edges set earlier — and handle merged cells and immutable style objects correctly.",[11,60],{"path":73,"title":74,"description":75,"type":8,"topics":76,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fadd-hyperlinks-to-excel-cells-with-python","Add Hyperlinks to Excel Cells with Python","Attach web, sheet, email and file links with openpyxl and xlsxwriter — including the style line that makes them look clickable, and when the HYPERLINK formula is the better choice.",[11,60],{"path":78,"title":79,"description":80,"type":8,"topics":81,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fapply-a-reusable-style-theme-across-an-excel-report","Apply a Reusable Style Theme Across an Excel Report","Stop scattering fonts and fills through your script — define a theme once with NamedStyle, apply it by role, and keep every generated report visually consistent.",[11,60],{"path":83,"title":84,"description":85,"type":8,"topics":86,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fapply-built-in-cell-styles-like-good-bad-and-neutral","Apply Built-In Cell Styles Like Good, Bad and Neutral","Use Excel's own built-in cell styles from Python with openpyxl — Good, Bad and Neutral, Title and the headline styles, Input, Calculation, Total, Note and the accent styles: the exact names openpyxl expects, applying them by value, what happens when you add direct formatting on top, how they appear in Excel's Cell Styles gallery, and when conditional formatting is the better tool.",[11,60],{"path":88,"title":89,"description":90,"type":8,"topics":91,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fapply-gradient-and-pattern-fills-with-openpyxl","Apply Gradient and Pattern Fills with openpyxl","Fill cells with solid colours, hatching patterns and two-colour gradients from Python: which colour a solid PatternFill really uses (and why a bgColor-only fill turns black), the pattern types and their foreground\u002Fbackground colours, linear and path GradientFill, fills in conditional formats, removing fills, and a rendered check of what each one looks like.",[11,60],{"path":93,"title":94,"description":95,"type":8,"topics":96,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fbuild-a-calendar-sheet-in-excel-with-python","Build a Calendar Sheet in Excel with Python","Generate a printable month-grid calendar in a workbook: the grid from Python's calendar module, weekends shaded, public holidays marked, events from a spreadsheet list written into their day cells, ISO week numbers down the side, twelve months on one sheet or one per tab, and a layout that prints on one page.",[10,11],{"path":98,"title":99,"description":100,"type":8,"topics":101,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fchange-the-default-font-of-an-excel-workbook-with-python","Change the Default Font of an Excel Workbook with Python","Make a generated workbook use your house font everywhere — not just in the cells you styled: set XlsxWriter's default_format_properties (also through pandas), understand why changing the Normal style in openpyxl does nothing to existing cells, use a template so openpyxl inherits the right default, keep bold and coloured cells in the same family, and verify the fonts that actually render.",[11,60,37],{"path":103,"title":104,"description":105,"type":8,"topics":106,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Ffreeze-header-row-in-excel-with-openpyxl","Freeze the Header Row in Excel with openpyxl","Freeze the header row in Excel from Python with openpyxl using ws.freeze_panes. Freeze rows, columns, or both, understand the anchor cell, and unfreeze — runnable.",[107,11,60],"messy-sheets",{"path":109,"title":110,"description":111,"type":8,"topics":112,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fhide-gridlines-and-set-zoom-with-openpyxl","Hide Gridlines and Set the Zoom Level with openpyxl","Control how a generated workbook looks the moment it opens: hide gridlines and headings, set the zoom, choose the selected cell and the first visible row, open in Page Layout view, hide zeros, set right-to-left sheets, and avoid the grouped-sheets trap when changing the active sheet.",[11,60],{"path":114,"title":115,"description":116,"type":8,"topics":117,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Findent-cells-to-show-a-hierarchy-with-openpyxl","Indent Cells to Show a Hierarchy with openpyxl","Lay out a chart of accounts, an organisation or a product tree the way people read hierarchies: children indented under their parent, parents in bold with rolled-up totals, and rows grouped so each branch can be collapsed. Work out each row's depth from a parent–child table, set Alignment(indent=...), roll values up the tree and add outline levels with openpyxl.",[11,10,60],{"path":119,"title":120,"description":121,"type":8,"topics":122,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Finsert-page-breaks-between-groups-with-openpyxl","Insert Page Breaks Between Groups with openpyxl","Make each region, customer or department start on a new printed page: find where each group ends, add manual row breaks with openpyxl, repeat the header on every page, add column breaks for wide sheets, clear old breaks, do the same with XlsxWriter, and prove the result by rendering a PDF and checking which group starts each page.",[11,10,23],{"path":124,"title":125,"description":126,"type":8,"topics":127,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fmerge-cells-and-centre-a-report-title-with-openpyxl","Merge Cells and Centre a Report Title with openpyxl","Add a merged, centred title banner to a generated report — merge_cells, styling the anchor cell, the MergedCell read-only trap, and why centre-across-selection is often better.",[11,60],{"path":129,"title":130,"description":131,"type":8,"topics":132,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Frotate-text-in-excel-cells-with-openpyxl","Rotate Text in Excel Cells with openpyxl","Angle header labels so a wide table of months, products or dates fits on screen, turn a side label vertical beside a block of rows, or stack letters top to bottom. Set textRotation with openpyxl — and understand its odd 0–180 and 255 values — size the header row so rotated text is not clipped, and do the same in xlsxwriter.",[11,60],{"path":134,"title":135,"description":136,"type":8,"topics":137,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fset-column-width-and-row-height-in-openpyxl","Set Column Width and Row Height in openpyxl","Set Excel column widths and row heights from Python with openpyxl, build an auto-fit pass by measuring content, hide columns, and set sensible defaults — runnable.",[11,60],{"path":139,"title":140,"description":141,"type":8,"topics":142,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fset-print-area-and-page-setup-with-openpyxl","Set the Print Area and Page Setup with openpyxl","Make a generated workbook print properly: print area, landscape orientation, fit to width, repeated header rows, margins, headers and footers, and page breaks.",[11,60],{"path":144,"title":145,"description":146,"type":8,"topics":147,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fstyle-whole-columns-and-rows-efficiently-with-openpyxl","Style Whole Columns and Rows Efficiently with openpyxl","Format entire columns and rows in large openpyxl workbooks without slowing the script down: what column and row styles actually do (and why they do not restyle cells that already hold data), reusing one Font object instead of creating thousands, named styles for the fastest path, styling only the used range, and checking the rendered result and the file's style count.",[11,60],{"path":149,"title":150,"description":151,"type":8,"topics":152,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fwrap-text-and-align-cells-with-openpyxl","Wrap Text and Align Cells with openpyxl","Make long text readable in a generated Excel report — wrap text inside cells, set row heights that fit the wrapped lines, align text to the top so multi-line rows read cleanly, indent hierarchies, rotate narrow headers, centre a title across columns without merging and shrink text as a last resort.",[11,60],{"path":154,"title":155,"description":156,"type":8,"topics":157,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fstyling-excel-cells-with-openpyxl\u002Fwrite-rich-text-in-a-cell-with-openpyxl","Write Rich Text in a Cell with openpyxl","Put more than one format in a single cell — a red, bold OVERDUE inside a status line, a highlighted keyword in a comment, H₂O and m² with real subscripts and superscripts. Build CellRichText from TextBlock and InlineFont objects, generate it from data, read existing rich text back, and avoid the load-and-save that silently flattens it.",[11,60],{"path":159,"title":160,"description":161,"type":8,"topics":162,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fformat-cells-in-a-live-workbook-with-xlwings","Format Cells in a Live Workbook with xlwings","Style a workbook that is open in Excel from Python: fill colours, fonts, number formats and column widths through xlwings' own properties, borders and conditional formats through the .api escape hatch, an Excel table with a built-in style, and the screen-updating and range-at-once habits that keep formatting thousands of cells fast — plus how this differs from formatting a file with openpyxl.",[163,11],"xlwings",{"path":165,"title":166,"description":167,"type":8,"topics":168,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-openpyxl-value-must-be-one-of-errors","Fix openpyxl \"Value must be one of\" and \"Max value is\" Errors","openpyxl validates style and settings values against the names Excel uses internally, so Side(style=\"bold\"), Alignment(horizontal=\"middle\"), PatternFill(\"Solid\") and orientation=\"Landscape\" all fail with ValueError: Value must be one of {...}. Translate the familiar names to the accepted ones, use openpyxl's constants, handle \"Max value is\" and colour errors, and watch for values that are only checked at save time — after half a file has been written.",[169,60,11],"troubleshooting",{"path":171,"title":172,"description":173,"type":8,"topics":174,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fclear-cell-contents-and-formatting-with-openpyxl","Clear Cell Contents and Formatting with openpyxl","Reproduce Excel's Clear menu in Python: clear values but keep formatting, reset formatting but keep values, remove comments and hyperlinks, or clear everything. Covers clearing a template's input area while keeping its formulas, and why merged cells make a simple clearing loop fail.",[60,11,10],{"path":176,"title":177,"description":178,"type":8,"topics":179,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fcopy-cell-styles-with-openpyxl","Copy Cell Styles from One Cell to Another with openpyxl","Copy fonts, fills, borders, alignment and number formats between cells with openpyxl — within a sheet, across sheets and between workbooks — plus column widths, row heights and whole-row formatting for new data.",[11,60],{"path":181,"title":182,"description":183,"type":8,"topics":184,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fmerge-repeated-group-labels-into-single-cells-with-openpyxl","Merge Repeated Group Labels into Single Cells with openpyxl","Turn a report where the region name repeats on every row into one merged, vertically centred label per group: find runs of equal values, merge them with openpyxl, handle nested groups so an inner label never spans two outer groups, keep borders tidy, and know when to hide repeats with conditional formatting instead so the sheet stays sortable.",[60,10,11],{"path":186,"title":187,"description":188,"type":8,"topics":189,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fuse-theme-colours-and-tints-in-openpyxl","Use Theme Colours and Tints in openpyxl","Colour Excel cells with the workbook theme instead of fixed RGB values using openpyxl: theme colour indexes and the swapped order of the first four, tints that lighten and darken like Excel's palette, resolving theme colours to hex for checks and HTML, and rebranding a whole report by changing the theme's accent colours — verified against a rendered copy.",[60,11],{"path":191,"title":192,"description":193,"type":8,"topics":194,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fwriting-dataframes-to-excel-with-pandas\u002Fauto-fit-column-widths-when-writing-with-pandas","Auto-Fit Column Widths When Writing with pandas","Stop Excel reports opening with ##### and truncated headers — measure content width in Python and set column widths with xlsxwriter or openpyxl, including a reusable helper.",[11,38,195],"pandas",{"path":197,"title":198,"description":199,"type":8,"topics":200,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fwriting-dataframes-to-excel-with-pandas\u002Fexport-a-styled-pandas-dataframe-to-excel","Export a Styled pandas DataFrame to Excel","Use pandas Styler to colour, bold and highlight a DataFrame, then write it to Excel with the styles intact — and learn which Styler features survive the trip, including why format() does not and what to use instead.",[11,38,195],{"path":202,"title":203,"description":204,"type":8,"topics":205,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fwriting-dataframes-to-excel-with-pandas\u002Fwrite-clickable-links-from-a-dataframe-to-excel","Write Clickable Links from a DataFrame Column to Excel","Turn a column of URLs into clickable links when writing a DataFrame to Excel: rely on xlsxwriter's automatic URL detection, write HYPERLINK formulas with friendly text, or set cell.hyperlink with openpyxl. Covers link text, internal sheet links, URL length limits and formula injection.",[38,11,195],1790972052271]