ich habe im Forum untenstehenden Code von Hajo gefunden.
Super!
Jetzt würde ich aber gerne, dass wenn z.B. in Zelle b5 eine "1" gefunden wurde, sämtliche Werte dieser Zeile automatisch mit der gleichen Formatierung versehen werden wie die "1"
Geht das?
Grüße
benjamin
Sub nachtraeglich()
' erstellt von Hajo.Ziplies@web.de 14.12.02
' SCHRIFT
' für Hintergrund RaZelle.Interior.ColorIndex
Dim RaBereich As Range, RaZelle As Range
' Bereich der Wirksamkeit
Set RaBereich = Range("b2:b72")
' ActiveSheet.Unprotect
For Each RaZelle In Selection
' überprüfen ob Zelle im vorgegebenen Bereich
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
' Kreuz entfernen
RaZelle.Borders(xlDiagonalDown).LineStyle = xlNone
RaZelle.Borders(xlDiagonalUp).LineStyle = xlNone
Select Case RaZelle.Value
Case "1"
RaZelle.Font.ColorIndex = 26
Case "2"
RaZelle.Font.ColorIndex = 24
Case "3"
RaZelle.Font.ColorIndex = 3
' usw.
Case Else
RaZelle.Font.ColorIndex = 0
End Select
End If
Next RaZelle
' ActiveSheet.Protect
Set RaBereich = Nothing
End Sub