+ Reply to Thread
Results 1 to 9 of 9

Adding multiple new series to a Scatter chart

  1. #1
    Registered User
    Join Date
    05-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Adding multiple new series to a Scatter chart

    Hi All,
    I am attempting to create a macro to add multiple series to a scatter chart. I have a range for both the X and Y Values (see attached).
    At present, I have been manually adding series one by one to the chart, but I have roughly a hundred series to add so this could get tiresome.
    I am fairly new to coding/VBA so your help would be much appreciated.

    Cheers,
    Matt

    TEST.xlsx

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

    Re: Adding multiple new series to a Scatter chart

    try this,

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Adding multiple new series to a Scatter chart

    hi Matt, welcome to Excelforum, option, press Run button or run code "test" - ALT+F8, select "test", press Run button
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding multiple new series to a Scatter chart

    This is great Andy, thanks heaps.
    Just to follow exactly what you have done here, you have set Xdata and Ydata as a Range, and somewhere told it to grab 3 columns of data for each.
    For example, if I wished to add another column for both X and Y for an additional data plot for each series, how would I modify the code?
    Thanks again for your help, and sorry if these are all basic 'newbie' type questions.
    Best,
    Matt

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

    Re: Adding multiple new series to a Scatter chart

    You would need to update the 3's in these two lines, which denotes how many columns to use.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding multiple new series to a Scatter chart

    Thanks Andy,
    Have I done something wrong here? It does not seem to want to plot when I change the code to denote one column as you suggest above.
    I have also added a title and axis labels to the code, which seems to be working ok.
    Thanks again for your help.
    Cheers,
    Matt

    Please Login or Register  to view this content.

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

    Re: Adding multiple new series to a Scatter chart

    How would you envisage the line to appear if you only give it 1 data value.

    to see a line you need a minimum of start xy and finish xy

  8. #8
    Registered User
    Join Date
    05-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding multiple new series to a Scatter chart

    Ah, now I feel foolish. Changing chart type would be useful ;-)
    Thanks very much Andy for your help.
    Regards,
    Matt

  9. #9
    Registered User
    Join Date
    05-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding multiple new series to a Scatter chart

    Hi Andy,
    Sorry to bother you again. I have been trawling the internet for a VBA solution to format the markers as defined (in the example, determined by column D).
    I have not yet been able to implement any of them successfully.
    Can you help at all?

    Thank you kindly.
    Best,
    Matt
    Attached Files Attached Files

+ 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. Scatter Plot Chart with multiple series
    By hyattj in forum Excel General
    Replies: 0
    Last Post: 08-14-2014, 03:36 PM
  2. [SOLVED] Adding multiple series on a single chart
    By Bruza005 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-30-2012, 12:56 AM
  3. XY (Scatter) chart - 1 series/multiple color
    By KHUY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2012, 06:41 AM
  4. Adding Multiple Series to a chart?
    By Stevie1980 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-10-2008, 06:13 AM
  5. Adding more series to a XY scatter chart
    By Graham Whitehead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2006, 11:20 PM

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