Makroprobleme
23.01.2004 14:22:32
Dominik
ich habe ein Makro zur Diagrammerstellung per Hand aufgenommen. Wenn ich das Makro aber erneut starten möchte kommt eine Fehlermeldung, in der 5.Spalte.
Excel fügt mir trotz der Fehlermeldung das Diagramm ein.
Was ist falsch im Code?
Sub Makro4()
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("Planschlagmessung ****.**.** - "). _
Range("B6:B366"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="AX025_aussen"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "AX025_aussen"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Winkel [°]"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Planschlag [µm]"
End With
ActiveChart.HasLegend = False
ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Interior.ColorIndex = xlNone
End Sub
CU
Dominik