AW: Zeilen ausblenden...
27.09.2018 15:18:04
David
Hallo,
Zeilen Ausblendet geht nicht. Ich bin schon einen Schritt weiter, und lasse einfach in der Schleife eine Abfrage stattfinden ob "keine" bzw. "leer" wenn das nicht zutrifft wird eine neue Datenreihe erstellt. Das funktioniert jetzt auch. Allerdings ist es eine xlColumnStacked und mit .SeriesCollection.NewSeries wird die neue Reihe, im selben Balken als zusätzlicher Wert hinzugefügt, dabei soll der Balken neben dem ersten stehen. xlColumnStaked ist notwendig, da es sich um Fehlerbalken handeln die nicht bei 0 starten. Hat zufällig jemand eine Idee wie ich den neuen Balken daneben bekomme?
Do Until StrComp(checkend, "Ende", vbTextCompare) = 0
If ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 2).Value = "" Or _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 2).Value = "keine" Then
Else
With cht1
With .SeriesCollection.NewSeries
If ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, _
2).Value = "Balken-Dunkelblau" Then
.XValues = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1))
.Values = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4))
.ApplyDataLabels
.Format.Fill.Visible = msoTrue
.Format.Fill.ForeColor.RGB = RGB(0, 53, 101)
.Format.Fill.Transparency = 0
.Format.Fill.Solid
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
' ########## Balken 2
ElseIf ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells( _
table_counter, 2).Value = "Balken-Metallgrau" Then
.XValues = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1))
.Values = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4))
.ApplyDataLabels
.Format.Fill.Visible = msoTrue
.Format.Fill.ForeColor.RGB = RGB(176, 181, 184)
.Format.Fill.Transparency = 0
.Format.Fill.Solid
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
' ########## Balken 3
ElseIf ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells( _
table_counter, 2).Value = "Balken-Hellblau" Then
.XValues = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1))
.Values = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Range( _
ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4), ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 4))
.ApplyDataLabels
.Format.Fill.Visible = msoTrue
.Format.Fill.ForeColor.RGB = RGB(141, 180, 226)
.Format.Fill.Transparency = 0
.Format.Fill.Solid
.Format.Line.Visible = msoTrue
.Format.Line.ForeColor.RGB = RGB(0, 0, 0)
' ########## Kein Balken
Else
.Format.Fill.Visible = msoFalse
.Format.Line.Visible = msoFalse
End If
End With
End With
series_counter = series_counter + 1
End If
table_counter = table_counter + 1
checkend = ThisWorkbook.Sheets("Efficiency_Waterfall_Chart").Cells(table_counter, 1).Value
Loop