Aug-21-2023, 06:45 PM
import openpyxl from openpyxl.styles import PatternFill datafile1 = openpyxl.load_workbook("C:\\Users\\ime1s\\Downloads\\MiCalculo.xlsx") fill_style = PatternFill(start_color="FDD835", end_color="FDD835", fill_type="solid") data_sheet1 = datafile1["Calculo"] data_sheet2 = datafile1["Calculo2"] for i in data_sheet1.iter_rows(): for cell in i: current_cell_value = cell.value cell_location = cell.coordinate if current_cell_value != data_sheet2[cell_location].value: cell.fill = fill_style datafile1.save("compared_file.xlsx")That's ok?