Sub Codes_Format_And_Color_From_B()
Dim ws As Worksheet
Dim r As Long
Dim lastRow As Long
Dim colorVal As Long
Set ws = ThisWorkbook.Worksheets("Codes")
lastRow = 98080 ' Vorgabe laut Anforderung
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
For r = 1 To lastRow
' Schriftfarbe aus Spalte B holen
colorVal = ws.Cells(r, "B").Font.Color
' Schriftfarbe auf A und C:L übertragen
ws.Range(ws.Cells(r, "A"), ws.Cells(r, "L")).Font.Color = colorVal
' Formate (ohne Schriftfarbe) aus B auf A und C:L übertragen
ws.Cells(r, "A").Interior.Color = ws.Cells(r, "B").Interior.Color
ws.Cells(r, "A").Font.Name = ws.Cells(r, "B").Font.Name
ws.Cells(r, "A").Font.Size = ws.Cells(r, "B").Font.Size
ws.Cells(r, "A").Font.Bold = ws.Cells(r, "B").Font.Bold
ws.Cells(r, "A").Font.Italic = ws.Cells(r, "B").Font.Italic
ws.Cells(r, "A").HorizontalAlignment = ws.Cells(r, "B").HorizontalAlignment
ws.Cells(r, "A").VerticalAlignment = ws.Cells(r, "B").VerticalAlignment
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Interior.Color = ws.Cells(r, "B").Interior.Color
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Font.Name = ws.Cells(r, "B").Font.Name
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Font.Size = ws.Cells(r, "B").Font.Size
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Font.Bold = ws.Cells(r, "B").Font.Bold
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).Font.Italic = ws.Cells(r, "B").Font.Italic
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).HorizontalAlignment = ws.Cells(r, "B").HorizontalAlignment
ws.Range(ws.Cells(r, "C"), ws.Cells(r, "L")).VerticalAlignment = ws.Cells(r, "B").VerticalAlignment
Next r
' Autofit
ws.Columns("A:L").AutoFit
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Format- und Farbübertragung abgeschlossen.", vbInformation
End Sub
Sub M_snb()
ThisWorkbook.Styles.Add "snb", Cells(1, 2)
Cells(1).CurrentRegion.Style = "snb"
End Sub
If Range(y).Interior.ColorIndex = -4142 Then
Range(x).Interior.Color = -4142
Else
Range(x).Interior.Color = Range(y).Interior.Color
end if
if Range(y).Interior.Pattern = xlNone then
Range(x).Interior.Pattern = xlNone
else
Range(x).interior.color = Range(y).Interior.Color
End if
Range(x).Interior.Color = IIF(Range(y).Pattern = xlnone, xlnone, Range(y).Interior.Color)
Sub Format_und_Farbe_von_B_auf_ACbisL_Ultra()
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
' --- FORMATIERUNG OHNE SCHLEIFE ---
With ws.Range("A1:L" & lastRow)
.Font.Name = "Calibri"
.Font.Size = 11
.Font.Italic = True
.Font.Bold = False
.HorizontalAlignment = xlCenter
End With
' --- SCHRIFTFARBE MIT MINIMALER SCHLEIFE ---
For r = 1 To lastRow
fColor = ws.Cells(r, "B").Font.Color
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
For r = 1 To lastRow
ws.Cells(r, "A").Resize(1, 12).Font.Color = ws.Cells(r, "B").Font.Color
Next r
dim Zelle as Range
for each Zelle in ws.Usedrange.Columns(2)
Zelle.Offset(0, -1).Resize(1, 12).Font.color = Zelle.Font.Color
next
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