ich hab ein Problem mit der Bedingten Formatierung, die ich über VBA mache.
Das funktioniert auch problemlos, aber was ich nicht verstehe ist, dass wenn man im Bereich der Zeilen irgendeine Einheit filtert in der Pivot, dann haut es die gesamte bedingte Formatierung raus.
Gleiches passiert auch, wenn ich mit einen Doppelklick auf einen Wert klicke und mir die Daten dazu einzeigen lasse, auch dann ist die Formatierung weg.
Hat jemand eine Idee, weshalb das passiert und was ich da anders machen könnte?
VG
Elmar
Range("K5").Select
Range("K5:AB" & irow3).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND($AE5>0;K5>0;K5>$AE5)" ~f~
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
~f~ "=UND($AF5>0;K5<$AF5;K5>0)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 15773696
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False