ich will ein Diagramm dynamisch erstellen lassen. Die Zeitreihen hängen von den Variablen ende und i ab.
Für SeriesCollection(1) funktioniert das einlesen auch, jedoch nicht für SeriesCollection(2). Wo könnte in meinem Code das Problem sein?
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
With ThisWorkbook.Worksheets("Time Series Indexiert")
Charts(1).SeriesCollection(1).XValues = .Range(.Cells(3, 1), .Cells(ende, 1))
Charts(1).SeriesCollection(1).Values = .Range(.Cells(3, i + 1), .Cells(ende, i + 1))
Charts(1).SeriesCollection(1).name = .Range("B2")
End With
With ThisWorkbook.Worksheets("Index Timing")
Charts(1).SeriesCollection(2).Values = .Range(.Cells(3, i + 1), .Cells(ende, i + 1))
Charts(1).SeriesCollection(2).name = .Range("B3")
End With
ActiveChart.Location Where:=xlLocationAsNewSheet, name:="Name"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
Vielen Dank
Matthias