leider kenn ich mich diagrammen gar nicht aus. ich habe mir das makro aufgezeuchnet. wie kann ich es dann so modifizieren, dass ich es normal starten kann. wenn ich das über vba laufen lasse, kommt eine fehlermeldung.
hier der code:
Sub dia()
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets("Tabelle1").Range("A1:K8"), PlotBy _
:=xlColumns
ActiveChart.SeriesCollection(3).Delete
ActiveChart.SeriesCollection(1).XValues = "=Tabelle1!R3C8:R8C8"
ActiveChart.SeriesCollection(1).Values = "=Tabelle1!R3C9:R8C9"
ActiveChart.SeriesCollection(1).Name = ""
ActiveChart.SeriesCollection(2).XValues = "=Tabelle1!R3C10:R8C10"
ActiveChart.SeriesCollection(2).Values = "=Tabelle1!R3C11:R8C11"
ActiveChart.SeriesCollection(2).Name = ""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Tabelle1"
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.PlotArea.Select
Application.CommandBars("Chart").Visible = True
With Selection.Border
.ColorIndex = 1
.Weight = xlThick
.LineStyle = xlContinuous
End With
Selection.Fill.TwoColorGradient Style:=msoGradientDiagonalDown, Variant:=2
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 43
.Fill.BackColor.SchemeColor = 46
End With
ActiveChart.Axes(xlCategory).MajorGridlines.Select
With Selection.Border
.ColorIndex = 1
.Weight = xlThin
.LineStyle = xlContinuous
End With
With ActiveChart.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlHundreds
.HasDisplayUnitLabel = True
End With
ActiveChart.Axes(xlCategory).DisplayUnitLabel.Select
ActiveChart.Axes(xlCategory).MajorGridlines.Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 1
.MarkerStyle = xlCircle
.Smooth = False
.MarkerSize = 25
.Shadow = False
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
With Selection
.MarkerBackgroundColorIndex = 4
.MarkerForegroundColorIndex = 1
.MarkerStyle = xlCircle
.Smooth = False
.MarkerSize = 25
.Shadow = False
End With
vielen dank
Andrej