Option
Explicit
Sub
Test()
Dim
objChart
As
Excel.Chart
With
ThisWorkbook.Worksheets(
"Tabelle1"
)
If
.ChartObjects.Count > 0
Then
Set
objChart = .ChartObjects(1).Chart
Else
Set
objChart = .Shapes.AddChart2().Chart
End
If
Do
While
objChart.SeriesCollection.Count > 0
Call
objChart.SeriesCollection(1).Delete
Loop
With
.Range(
"A9"
)
objChart.ChartType = xlLine
Call
objChart.SetSourceData( _
Source:=.Parent.Range(.
End
(xlDown), .
End
(xlToRight)), _
PlotBy:=xlColumns)
End
With
End
With
End
Sub