mit diesem Code zaubere ich mir ein Diagramm aufs Arbeitsblatt.
Sub Makro1()
Range("D5:G6").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Tabelle1").Range("D5:G6"), PlotBy _
:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="Tabelle1"
ActiveChart.PlotArea.Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
ActiveChart.Axes(xlValue).MajorGridlines.Select
Selection.Delete
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 44
.Pattern = xlSolid
End With
ActiveWindow.Visible = False
Windows("Mappe2").Activate
Range("A1").Select
End Sub
Wie kann ich nun selbiges wieder löschen per Makro? Bzw. wie kann ich das Diagramm anpsrechen bzw. benennen damit ich ein Delete zuweisen kann.
Gruß
Michael