Als Antwort auf diesen Beitrag
Hallo Daniel,
wie gesagt, ich habe nichts böses ahnend Copilot gesagt, ich suche ein Makro, dass Formatierung und Schriftfarbe von Spalte B auf die Spalten A und C:L überträgt und gesagt dass die Formate einheitlich sind und sich die Farbe von Zeile zu Zeile unterscheidet.
Ich dachte dabei an konkret Calibri, 11, kursiv, zentriert, nicht fett. War nur zu faul das alles auszuschreiben, weil ich der Überzeugung war, Copilot macht dann sowas wie man bei Werte Einfügen - Formatierung hat.
An Hintergrunfarben hatte ich nie vor etwas zu ändern und dann hatte ich den Schlamassel.
Aber wie gesagt, ist ja jetzt gelöst.
Danke für die Erklärung
Christian
Inzwischen hab ich das ganze auch nochmal bei Copilot eingegeben und das hier bekommen:
Sub Format_und_Farbe_von_B_auf_ACbisL()
Dim ws As Worksheet: Set ws = ActiveSheet
Dim lastRow As Long
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row
Dim r As Long
Dim fColor As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
For r = 1 To lastRow
' Schriftfarbe aus B holen
fColor = ws.Cells(r, "B").Font.Color
' Formatblock einmal setzen
With ws.Range(ws.Cells(r, "A"), ws.Cells(r, "L"))
.Font.Name = "Calibri"
.Font.Size = 11
.Font.Italic = True
.Font.Bold = False
.HorizontalAlignment = xlCenter
End With
' Schriftfarbe auf A und C:L setzen
ws.Cells(r, "A").Font.Color = fColor
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Font.Color = fColor
Next r
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub