Hi all,
Just wondering if someone can point me to a thread or give me advice on how to have a chart update its values after the data ranges have been updated? Specifically, I have a sheet that gets updated monthly, adding the new months data for that update. How can I apply this kind of logic to charts? Here's the recorded macro I have:
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("Graphs").Range("L4"), PlotBy:= _
xlRows
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "=Monthly!R5C6:R5C65"
ActiveChart.SeriesCollection(1).Values = "=Monthly!R7C6:R7C62"
ActiveChart.SeriesCollection(1).Name = "=Monthly!R7C5"
ActiveChart.SeriesCollection(2).Values = "=Monthly!R8C6:R8C62"
ActiveChart.SeriesCollection(2).Name = "=Monthly!R8C5"
ActiveChart.SeriesCollection(3).Values = "=Monthly!R9C6:R9C62"
ActiveChart.SeriesCollection(3).Name = "=Monthly!R9C5"
ActiveChart.SeriesCollection(4).Values = "=Monthly!R10C6:R10C62"
ActiveChart.SeriesCollection(4).Name = "=Monthly!R10C5"
ActiveChart.SeriesCollection(5).Values = "=Monthly!R11C6:R11C62"
ActiveChart.SeriesCollection(5).Name = "=Monthly!R11C5"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Graphs"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Chart 1 Inustry Price Index"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.Legend.Select
Selection.Position = xlBottom
ActiveChart.PlotArea.Select
Thankee big-big!
Bookmarks