XL2007, Symbolsatz, .ShowIconOnly in einigen Zelle
Reinhard
in einem Extrablatt wurde eine Pivotabelle erzeugt.
In Spalte F möchte ich bei den dortigen Datumswerten aufgrund deren Datümern Symbole anzeigen lassen.
Also das Symbol UND den Datumswert. Das klappt auch.
Als "legende" stehen in E1:E3 drei datümer die jeweils ein anderes Symbol auslösen der drei möglichen.
Das klappt auch.
Nur, in E1:E3 möchte ich nicht den Datumswert sehen, sondern nur das Symbol.
Und genau das klappt nicht, sage ich für E1:E3 mittels ":ShowIconOnly=True" nur das Symbol zeigen so gilt das leider auch für Spalte F mit :-(
Nachstehend der Code. Es geht um das Fettgedruckte. Kommentiere ich es aus, sehe ich in E1:E3 Datümer die ich nicht sehen möchte, nur das Symbol wäre ok. Kommentiere ich es nicht aus, sehe ich in F auch keine Werte mehr :-(
Da ich das Symbol in E1:E3 mittels ".HorizontalAlignment = xlRight" nach rechts rücken will nutzt es mir auch nix da in E1:E3 die Schriftfarbe auf weiß zu stellen.
Was soll ich tun?
Danke ^ Gruß
Reinhard
Sub SymboleInPivottabelle(ByVal strZDatei As String, ByVal strZBlatt As String)
Dim lngZei As Long
With Workbooks(strZDatei).Worksheets(strZBlatt)
lngZei = .Cells(Rows.Count, "F").End(xlUp).Row
With Application.Union(Range("F1:F" & lngZei), Range("E1:E3"))
.FormatConditions.Delete
.FormatConditions.AddIconSetCondition
.FormatConditions(.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1)
.ReverseOrder = False
.ShowIconOnly = False
.IconSet = ActiveWorkbook.IconSets(xl3Signs)
End With
With .FormatConditions(1).IconCriteria(2)
.Type = xlConditionValueNumber
.Value = "=Heute() - 31"
.Operator = 7
End With
With .FormatConditions(1).IconCriteria(3)
.Type = xlConditionValueNumber
.Value = "=Heute() - 1"
.Operator = 7
End With
.EntireColumn.AutoFit
End With
' With .Range("E1:E3")
' .HorizontalAlignment = xlRight
' .FormatConditions(1).ShowIconOnly = True
' End With
End With
End Sub