ich habe ein Makro, welches in Abhängigkeit von der Zellfarbe (keine Farbe!) auf die Zelle eine bedingte Formatierung hinterlegen soll (Wenn Zellwert = 0, Schriftfarbe = weiß)
Sub bedformattest()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Selection
'If c.Font.Bold = True Then
c.Interior.ColorIndex = xlNone
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="0"
Selection.FormatConditions(1).Font.ColorIndex = 2
End If
Next c
Application.ScreenUpdating = True
End
Sub
Das funktioniert soweit auch wunderbar. Aber die bedingte Formatierung wird leider für alle _
Zellen in der Selektion angewandt. Auch für die, die hellgelb oder hellblau ausgefüllt sind (colorindex = 34/ 37). Was mache ich falsch, daß die Voraussetzung Colorindex = xlnone nicht beachtet wird?
Vielen Dank für Eure Ideen.
Grüße, Andreas Hanisch