VillaBilla,
Open your workbook and press Alt+F11 to take you to the VBA Editor. I
the left pane double click Module 1 and as seen below add the line
ActiveChart.Parent.Name = "mychart" to your code.
Then type out another Sub as shown below called Sub delchart.
Then back in your workbook add another button to your worksheet an
attach the macro delchart to it by right-clicking the new button an
choosing Assign Macro and selecting the macro delchart.
That should work
Regards
Seamus
__________________________________________________
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 25.2.2004 by Registered User
'
'
Range("B3:J3,B5:J5").Select
Range("B5").Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceDat
Source:=Sheets("Sheet1").Range("B3:J3,B5:J5"), _
PlotBy:=xlRows
ActiveChart.SeriesCollection(1).Name = "=""Target"""
ActiveChart.SeriesCollection(2).Name = "=""Actuals"""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
ActiveChart.Parent.Name = "mychart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "T vs A"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveWindow.Visible = False
Windows("try out.xls").Activate
Range("A3").Select
End Sub
___________________________________________________
Sub delchart()
ActiveSheet.ChartObjects("mychart").Activate
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Selection.Delete
End Su