+ Reply to Thread
Results 1 to 4 of 4

Adding Chart data with VBA

  1. #1
    Registered User
    Join Date
    10-20-2017
    Location
    Phoenix
    MS-Off Ver
    Ofccie 2016
    Posts
    2

    Adding Chart data with VBA

    Hello, I'm a first time poster/website visitor.

    In my work I do stochastic simulations which generate hundreds or thousands of pairwise results (each one is a few hundred x,y pairs). I want to plot (overlay) all the results (or at least up to the Excel limit) but of course it's tedious to add each pair to an Excel scatter plot.

    By recording a macro I see the VBA code to add the new data pairwise is:

    ActiveSheet.ChartObjects("Chart 5").Activate
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.FullSeriesCollection(15).XValues = "=profiles!$AC$6:$AC$1000"
    ActiveChart.FullSeriesCollection(15).Values = "=profiles!$AD$6:$AD$1000"

    where in this example I'm adding a 15th dataset to Chart5 in worksheet "profiles" from the indicated cells.

    It seems simple to automate this process to add datasets up to the limit (255?) but I need to use an addressable (row#,col#) description of the data location rather than the "$AC$6" format. My first tries have failed so I ask for help in this forum.

    steve

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: Adding Chart data with VBA

    Quote Originally Posted by Hansenaz View Post
    but I need to use an addressable (row#,col#) description of the data location rather than the "$AC$6" format.
    Why ?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-20-2017
    Location
    Phoenix
    MS-Off Ver
    Ofccie 2016
    Posts
    2

    Re: Adding Chart data with VBA

    I want to add another 100 data pairs which I could do using the macro code if I could address the ranges in numbered (row,column) format, or some other incremental method. I do rather simple VBA programming and I can't tell if that's what your code does.

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: Adding Chart data with VBA

    why?
    many vba commands give the same result, e.g.:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help on adding chart data from different Tab
    By Kalaiselvan K M in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-07-2015, 07:34 AM
  2. [SOLVED] Pivot Chart adding data together in line chart
    By jennieS in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-11-2013, 05:37 AM
  3. Adding More Data to a Stacked Chart
    By Phillycheese5 in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 07-01-2011, 03:33 AM
  4. Adding more data labels to pie chart
    By ctolson in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-25-2010, 10:21 AM
  5. adding data over existing chart
    By Diesel13 in forum Excel General
    Replies: 1
    Last Post: 03-04-2010, 10:30 AM
  6. adding information to chart data
    By andreas_d in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2007, 02:26 AM
  7. [SOLVED] adding data to a chart
    By inquirer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2006, 04:45 AM

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