I am using openpyxl to write some data to excel sheet. In my script, I need to append data to the same cell and highlight with different color for the new added data. Currently, I tried below but it turns out all the data's color will change at once. Is there any way to change one word's color in the same cell?
from openpyxl import Workbook
from openpyxl.styles import Font
from openpyxl.styles import colors
book = Workbook()
sheet = book.active
sheet.cell(row=1, column=2).value = "11111"
sheet.cell(row=1, column=2).font = Font(color=colors.GREEN)
sheet.cell(row=1, column=2).value += " 12345"
sheet.cell(row=1, column=2).font = Font(color=colors.RED)
sheet.cell(row=1, column=2).value += " 22222"