+ Reply to Thread
Results 1 to 7 of 7

Chart series don't extend

  1. #1
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Chart series don't extend

    Hi,

    I'm trying to extend the chart according to new added values. Here is the sample code i have recorded through a macro, but it doesn't seem to work when i run the code? Any help or tweak to the code is much appreciated. Thanks in advance!

    Please Login or Register  to view this content.
    The same has been posted here:
    http://www.vbaexpress.com/forum/show...176#post391176
    Last edited by JayeshG; 05-31-2019 at 02:17 PM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Chart series don't extend

    It's a bit more difficult when you have the data going across instead of down. It is easy to get a row number or a column number. However with a column number you have to convert it to a column letter. Also, if you had the data going down, then you would not need VBA at all, put the data into an Excel Table and building the chart off of it.

    However, there is a third option and that does not involve Tables or VBA: named dynamic ranges. They will work no matter how your data is organized.

    Here are two wikis: one describes how to make a named dynamic range and the other how to use them in charts.
    http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges
    http://www.utteraccess.com/wiki/Dynamic_Charting
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: Chart series don't extend

    Thanks, dflak. My question is if we can change the chart range manually even though data is spread across, then we can have some solution of this through VBA. I tried different ways through code to change the chart but still unsuccessful.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Chart series don't extend

    Does "extend the range" mean columns beyond Z, or series based on cell A2?
    Why not post the sample file?
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: Chart series don't extend

    Sure protonLeah. Thanks! Here is the sample file attached...

    FYI - I've modified the data so ignore the range values in code above. Thanks!

    Currently, the chart shows the values from year 2008 through 2017, i need a vba which can extend the chart till year 2028 with rest of the data points or series. Let me know if you need more info. Thanks!
    Attached Files Attached Files
    Last edited by JayeshG; 05-31-2019 at 07:03 PM.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Chart series don't extend

    Option One: no vba dynamic name ranges:
    Adj.Cash =OFFSET(Schart!$D$25,0,0,1,NumYears)
    Adj.Rtn =OFFSET(Schart!$D$23,0,0,1,NumYears)
    Eco.Profit =OFFSET(Schart!$D$24,0,0,1,NumYears)
    Goodwill =OFFSET(Schart!$D$26,0,0,1,NumYears)
    NumYears =COUNT(Schart!$21:$21)
    REV =OFFSET(Schart!$D$22,0,0,1,NumYears)
    SeriesNames =Schart!$A$22:$A$26
    x.axis =OFFSET(Schart!$D$21,0,0,1,NumYears)
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: Chart series don't extend


+ 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. How to extend time series with 0 values
    By M_M_R in forum Excel General
    Replies: 1
    Last Post: 09-25-2015, 07:14 AM
  2. Extend/Add Series for PowerPoint Graph
    By poptcorn in forum PowerPoint Formatting & General
    Replies: 0
    Last Post: 12-15-2014, 07:38 PM
  3. Unable to extend series.
    By mpt83 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-21-2013, 11:41 AM
  4. a formula to extend series
    By Ramzes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-24-2010, 07:40 AM
  5. How can I extend the series of a hyperlink
    By pcrone in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2008, 01:53 AM
  6. [SOLVED] Extend series
    By Traci in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-16-2006, 10:35 PM
  7. [SOLVED] can't extend a date series
    By Easydoesit in forum Excel General
    Replies: 1
    Last Post: 02-23-2005, 04:06 PM

Tags for this Thread

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