I’m using openpyxl
I just want to change the colour font of ALL CELLS IN A ROW IF the cell of a specific column is NOT None or !=. However, after several trials modifying my code. The result formats all the cells instead.
col_check = sheet.max_row
red_font = Font(color='FF0000')
for row in range(row+1,col_check):
if sheet.cell(row=row+1,column=col_check).value !='':
for col in range(col_check+1):
sheet.cell(row=row+1,column=col).font = red_font
Tried to make different variations of my code but I still kept having the same results.