könntet ihr bitte mal auf meinen Programm Code einen Blick werfen.
Bekomme immer Fehlermeldung, weiss aber nicht warum!!?!!
Sub DiagrammErstellen()
Dim Dia As ChartObject
Dim s As String
Sheets("DRG Info").ChartObjects.Delete
Set Dia = Sheets("DRG Info").ChartObjects.Add(-20, 175, 300, 250)
ChartObjects.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Schleife").Range("A2").CurrentRegion, _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="DRG Info"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "DRG:" & " " & Sheets("Berechnung").Range("A5")
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Tage"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Euro"
End With
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowNone, LegendKey:=False
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 6
.Weight = xlThick
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
End Sub
Danke!! ....schon im Voraus!!
Wolfgang