+ Reply to Thread
Results 1 to 2 of 2

Graph series

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-24-2008
    Location
    leicester
    MS-Off Ver
    Microsoft 365
    Posts
    161

    Graph series

    Hi,



    I have tried to write a macro to build the graph automatcially based on using offset series

       Charts.Add
        ActiveChart.ChartType = xlColumnClustered
        ActiveChart.SetSourceData Source:=Sheets("data").Range("F5")
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(1).XValues = "=offset chart.xls'!chtCats"
        ActiveChart.SeriesCollection(1).Values = "=offset chart.xls'!chtValA"
        ActiveChart.SeriesCollection(1).Name = "=data!R4C2"
        ActiveChart.SeriesCollection(2).Values = "=offset chart.xls'!chtValB"
        ActiveChart.SeriesCollection(2).Name = "=data!R4C3"
        ActiveChart.Location Where:=xlLocationAsNewSheet
    however i am unsure as to why it needs to pull the name of the xls, as i need this to be dynamic as every day i would like to be able to run the macro to create the graph.

    Any ideas on how i get round this?
    ps i have posted this to a reply to an original issue i had with have variable amounts of data when trying to create a graph. Apologies if this breaks any rules

    Thanks

    Antony

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Graph series

    Just include a link to your other post to save other having to search
    http://www.excelforum.com/excel-char...s-of-data.html

    I have replied to the other thread.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

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