0

I was wondering if it was possible to color only some lines of text/characters with openpyxl and output them on the same excel sheet?

Example:

The dog is red. The man is blue. My favorite color is black.

To:

The dog is [blue] red [/blue]. The man is [blue] blue [/blue] . My favorite color is [blue] yellow [/blue].

I have the strings and position of the strings that need to be in color, and even if it's the same color (blue or green) it would be fine.

Thanks!

Note: [blue] [/blue] means the color within the brackets are blue.

okeoke
  • 83
  • 1
  • 7
  • According to [this post](https://stackoverflow.com/questions/28774757/editing-workbooks-with-rich-text-in-openpyxl), `openpyxl` does not support formatting before cell level. You can however try `xlrd` which is mentioned [here](https://stackoverflow.com/questions/12371787/how-do-i-find-the-formatting-for-a-subset-of-text-in-an-excel-document-cell). – Henry Yik Jun 27 '19 at 06:43
  • Possible duplicate of [Editing workbooks with rich text in openpyxl](https://stackoverflow.com/questions/28774757/editing-workbooks-with-rich-text-in-openpyxl) – Charlie Clark Jun 27 '19 at 08:44

0 Answers0