Dim
i
As
Integer
, endzeile
As
Integer
, maxWxAxe
As
Integer
Dim
c
As
Chart
Dim
ca
As
Axis
For
i = 3
To
28
If
(ActiveSheet.Cells(i, 1) =
""
)
Then
Exit
For
Next
i
endzeile = i - 1
maxWxAxe = Application.WorksheetFunction.Max(ActiveSheet.Range(Cells(3, 1), Cells(endzeile, 1)))
Set
c = ActiveSheet.ChartObjects(1).Chart
With
c
.ChartType = xlXYScatterLinesNoMarkers
.HasTitle =
True
.ChartTitle.Characters.Text =
"Ergebnisse"
.Axes(xlCategory, xlPrimary).HasTitle =
True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"X-Achse"
.Axes(xlValue, xlPrimary).HasTitle =
True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text =
"Y-Achse"
.HasLegend =
True
.Legend.Position = xlLegendPositionBottom
.SetSourceData Source:=ActiveSheet.Range(Cells(2, 1), Cells(endzeile, 3)), PlotBy:=xlColumns
End
With
Set
ca = c.Axes(xlCategory)
With
ca
.MinimumScale = 0
.MaximumScale = maxWxAxe
.MajorUnit = 1
End
With
Set
c =
Nothing
Set
ca =
Nothing