Results 1 to 9 of 9

Updating Charts

Threaded View

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Updating Charts

    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!
    Last edited by Mordred; 12-24-2010 at 10:03 AM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1