Changing Input to code that creates a chart

A

Andreww

Hi - I have a report that has a chart in it. Every time the use
changes the dimensions / measures of the report grid, I want the chart
to reflect that change. At the moment I can't see how to even delete
my chart and then recereate it with different data range.

Sub make_chart()
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("Detail").Range("B7:H9"),
PlotBy:= _
xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="Detail"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub

Ideally I would like to get some code that means the chart is updated
and when the report grid changes, if that's a lot of grief then just
being able to delete existing chart and then define a new one would
do.

Any help appreciated.

Thanks

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top