Path: blob/master/Excel/Excel_Apply_Custom_Styles.ipynb
2972 views
Kernel: Python 3
Excel - Apply Custom Styles
Tags: #excel #openpyxl #font #border #background #naas #finance #snippet
Author: Sébastien Grech
Last update: 2023-04-12 (Created: 2023-02-07)
Description: This notebook provides instructions on how to apply custom styles to an Excel spreadsheet.
Input
Import libraries
In [1]:
Setup your variables
In [2]:
Setup your custom style
NB: Colors must be aRGB hex values : 'black' = '000000'
In [3]:
In [4]:
In [5]:
In [6]:
Model
Load Excel file and get active worksheet
In [7]:
Apply sheet style : Font and border
In [8]:
Apply number format
In [9]:
Apply header format
In [10]:
Apply total format
In [11]:
Output
Save new excel
In [12]:
Share your excel
In [ ]: