AW: Diagrammdaten aus Berechnung
15.02.2019 12:53:52
Nepumuk
Hallo Luisa,
dann kann ich dir natürlich nur eine Vorlage liefern:
Public Sub Luisa()
Dim objChartObject As ChartObject
Dim objSeries As Series
Dim vntValues1 As Variant, vntValues2 As Variant, vntXvalues1 As Variant
Dim ialngIndex As Long
vntValues1 = Array(0.32, 0.18, Empty, 0.43, 0.5, 0.39)
Redim vntValues2(LBound(vntValues1) To UBound(vntValues1))
For ialngIndex = LBound(vntValues1) To UBound(vntValues1)
If Not IsEmpty(vntValues1(ialngIndex)) Then vntValues2(ialngIndex) = 1 - vntValues1(ialngIndex)
Next
vntXvalues1 = Array("2017", "2018", Empty, "06 + 07", "08 + 09", "10 + 11")
Set objChartObject = Tabelle2.ChartObjects.Add(Left:=100, Top:=100, Width:=400, Height:=300)
With objChartObject.Chart
.ChartType = xlColumnStacked100
Set objSeries = .SeriesCollection.NewSeries
With objSeries
.Format.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Name = "out of target"
.Values = vntValues1
.XValues = vntXvalues1
End With
Set objSeries = .SeriesCollection.NewSeries
With objSeries
.Format.Fill.ForeColor.RGB = RGB(0, 176, 80)
.Name = "in target"
.Values = vntValues2
End With
Set objSeries = Nothing
.HasTitle = True
.ChartTitle.Text = "Production Start on Time DOMBE/F"
.HasLegend = True
.Legend.Position = xlLegendPositionBottom
End With
Set objChartObject = Nothing
End Sub
Gruß
Nepumuk