import openpyxl from openpyxl import load_workbook file_path = r"C:\Users\renet\.openclaw\workspace\buchhaltungs-app\Nebenkosten 2020.xlsx" wb = load_workbook(file_path, data_only=True) sheets = ['Körger 2020', 'KrohnWelling 2020', 'Körger 2021', 'KrohnWelling 2021', 'Körger 2022', 'KrohnWelling 2022', 'KrohnWelling 2023', 'Körger 2023)', 'Brandt 2023', 'Brandt 2024'] print("Heizkosten und Müll aus allen Sheets:\n") for sheet_name in sheets: if sheet_name in wb.sheetnames: ws = wb[sheet_name] print(f"=== {sheet_name} ===") # Zeilen 13-25 nach Heizung und Müll suchen for row in range(13, 26): cell_a = ws.cell(row=row, column=1).value cell_b = ws.cell(row=row, column=2).value # Gesamtkosten cell_k = ws.cell(row=row, column=11).value # Ihr Anteil (Spalte K) if cell_a and ('heiz' in str(cell_a).lower() or 'Heiz' in str(cell_a)): print(f" Zeile {row}: {cell_a}") print(f" Gesamtkosten: {cell_b}") print(f" Anteil: {cell_k}") if cell_a and ('müll' in str(cell_a).lower() or 'Müll' in str(cell_a) or 'muell' in str(cell_a).lower()): print(f" Zeile {row}: {cell_a}") print(f" Gesamtkosten: {cell_b}") print(f" Anteil: {cell_k}") print()