Moin allerseits,
als Neuanwender von VBA in Excel 2000 habe ich die Aufgabe bekommen, ein Makro zu programmieren, welches aus verschiedenen Werten in verschiedenen Arbeitsblättern automatisch Diagramme erstellt. Mit der "Makro auzeichnen"-Funktion habe ich schon ein, zwei Durchgänge gemacht (es sind insgesamt 11 Arbeitsblätter) und dachte mir, dass ich den Rest in der Programmiermaske für VBA in Excel eintippe.
Beim Starten des Makros taucht leider ein Fehler auf, mit dem ich nicht zurechtkomme - Kann mir hier jemand helfen? Der Code sieht wie folgt aus, das Debugprogramm verweist mich auf die Zeile
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Gehalt Ba"
Vielen Dank für jegliche Rückmeldung!
BenSvuettner
als Neuanwender von VBA in Excel 2000 habe ich die Aufgabe bekommen, ein Makro zu programmieren, welches aus verschiedenen Werten in verschiedenen Arbeitsblättern automatisch Diagramme erstellt. Mit der "Makro auzeichnen"-Funktion habe ich schon ein, zwei Durchgänge gemacht (es sind insgesamt 11 Arbeitsblätter) und dachte mir, dass ich den Rest in der Programmiermaske für VBA in Excel eintippe.
Beim Starten des Makros taucht leider ein Fehler auf, mit dem ich nicht zurechtkomme - Kann mir hier jemand helfen? Der Code sieht wie folgt aus, das Debugprogramm verweist mich auf die Zeile
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Gehalt Ba"
Vielen Dank für jegliche Rückmeldung!
BenSvuettner
Quellcode
- Sub STUTZ_DIAGRAMME()
- Charts.Add
- ActiveChart.ChartType = xlXYScatter
- ActiveChart.SetSourceData Source:=Sheets("004").Range("B2:F15"), PlotBy:= _
- xlColumns
- ActiveChart.SeriesCollection(1).Delete
- ActiveChart.SeriesCollection(1).Delete
- ActiveChart.SeriesCollection(1).Delete
- ActiveChart.SeriesCollection(1).Delete
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection(1).XValues = "='004'!R7C6"
- ActiveChart.SeriesCollection(1).Values = "='004'!R27C6"
- ActiveChart.SeriesCollection(1).Name = "=""""""004"""""""
- ActiveChart.SeriesCollection(2).XValues = "='011 DTV'!R7C6"
- ActiveChart.SeriesCollection(2).Values = "='004'!R27C6"
- ActiveChart.SeriesCollection(2).Name = "=""""""011 DTV"""""""
- ActiveChart.SeriesCollection(3).XValues = "='145'!R7C6"
- ActiveChart.SeriesCollection(3).Values = "='145'!R27C6"
- ActiveChart.SeriesCollection(3).Name = "=""""""145"""""""
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection(4).XValues = "='146 DTV'!R7C6"
- ActiveChart.SeriesCollection(4).Values = "='146 DTV'!R27C6"
- ActiveChart.SeriesCollection(4).Name = "=""""""146 DTV"""""""
- ActiveChart.SeriesCollection(5).XValues = "='174 DTV'!R7C6"
- ActiveChart.SeriesCollection(5).Values = "='174 DTV'!R27C6"
- ActiveChart.SeriesCollection(5).Name = "=""""""174 DTV"""""""
- ActiveChart.SeriesCollection(6).XValues = "='175'!R7C6"
- ActiveChart.SeriesCollection(6).Values = "='175'!R27C6"
- ActiveChart.SeriesCollection(6).Name = "=""""""175"""""""
- ActiveChart.SeriesCollection(7).XValues = "='185'!R7C6"
- ActiveChart.SeriesCollection(7).Values = "='185'!R27C6"
- ActiveChart.SeriesCollection(7).Name = "=""""""185"""""""
- ActiveChart.SeriesCollection(8).XValues = "='205 DTV'!R7C6"
- ActiveChart.SeriesCollection(8).Values = "='205 DTV'!R27C6"
- ActiveChart.SeriesCollection(8).Name = "=""""""205 DTV"""""""
- ActiveChart.SeriesCollection(9).XValues = "='214'!R7C6"
- ActiveChart.SeriesCollection(9).Values = "='004'!R27C6"
- ActiveChart.SeriesCollection(9).Name = "=""""""214"""""""
- ActiveChart.SeriesCollection(10).XValues = "='215 DTV'!R7C6"
- ActiveChart.SeriesCollection(10).Values = "='004'!R27C6"
- ActiveChart.SeriesCollection(10).Name = "=""""""215 DTV"""""""
- ActiveChart.SeriesCollection(11).XValues = "='216'!R7C6"
- ActiveChart.SeriesCollection(11).Values = "='216'!R27C6"
- ActiveChart.SeriesCollection(11).Name = "=""""""216"""""""
- ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Gehalt Ba"
- With ActiveChart
- .HasTitle = True
- .ChartTitle.Characters.Text = "Gehalt Ba"
- .Axes(xlCategory, xlPrimary).HasTitle = True
- .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _
- "Öllaufleistung in km"
- .Axes(xlValue, xlPrimary).HasTitle = True
- .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Gehalt Ba in ppm"
- End With