+ Reply to Thread
Results 1 to 4 of 4

Programmable charts

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    Belgrade
    MS-Off Ver
    Excel 2003
    Posts
    2

    Programmable charts

    Hi all!

    I am new here, and I hope someone can (and will) help me.

    I would like to make macro which will draw chart, but user will specify which rows to use in chart. Because there will be a lot of data and is useful to choose only 3 to 5 series to plot.
    The x value is common for all plots.

    I attached some example, just that you can understand what I want.

    Thank you in advance!
    Attached Files Attached Files

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

    Re: Programmable charts

    Here is one way using Autofilter.
    The listbox is a multi select style listbox.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-18-2009
    Location
    Belgrade
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Programmable charts

    That is good idea for that type of table. Thks!

    Actually, I also wondering is it possible to use variables in code for adding series to the chart:

    ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R10C4:R10C10"
    ActiveChart.SeriesCollection(1).Values = "=Sheet1!R11C4:R11C10"
    ActiveChart.SeriesCollection(1).Name = "=""Hc1"""

    I tried something like that (..."=Sheet1!Rvarible1Cvariable2:Rvariable3Cvariable4" ) but it didn't work. Maybe something else.?
    The main thing is that I want to use variables to add series to chart, beacuse I will have changeable number of rows and columns in the table.

    I hope that you can understand me.

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

    Re: Programmable charts

    If you turn the data table in to a List then it will automatically expand for new rows of data.

    Here is the code to add new series.

    Please Login or Register  to view this content.
    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)

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