Results 1 to 3 of 3

Series formula too long error in VBA charts

Threaded View

  1. #1
    Registered User
    Join Date
    07-02-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    1

    Series formula too long error in VBA charts

    Hi,

    I have the following data with 23 departments.
    The row one department cells are merged.

    testdata12.png

    I am trying to make two charts using VBA; one for Actual and one For % of total by the following code. I am getting two graphs until in the For loop of i Column the values do not exceed 35 and 36 respectively in place of 29 and 30 respectively. As I exceed the values 35 and 36 resp, it shows 'Series Formula Too Long' error and the grphs are not plotted. Please tell me why this is happening and what is the solution for the same.
    Thanks.

    Sub TwoCharts11()
    
    
    Dim rChart1 As Range
    Dim rChart2 As Range
    Dim iColumn As Long
    
    
    Dim cht1 As Chart
    Dim cht2 As Chart
    
    
    Const StrtRow As Long = 2
    Const EndRow As Long = 6
    
    
    With ActiveSheet
    
    
    Set rChart1 = .Range(.Cells(StrtRow, "B"), .Cells(EndRow, "B"))
    Set rChart2 = .Range(.Cells(StrtRow, "B"), .Cells(EndRow, "B"))
    
    
    For iColumn = 3 To 29 Step 2
    Set rChart1 = Union(rChart1, .Range(.Cells(StrtRow, iColumn), .Cells(EndRow, iColumn)))
    Next
    
    
    For iColumn = 4 To 30 Step 2
    Set rChart2 = Union(rChart2, .Range(.Cells(StrtRow, iColumn), .Cells(EndRow, iColumn)))
    Next
    
    
    Set cht1 = .Shapes.AddChart.Chart
    Set cht2 = .Shapes.AddChart.Chart
    
    With cht1
    .Parent.Left = .Parent.Left - .Parent.Width / 2
    .ChartType = xlColumnClustered
    .SetSourceData rChart1
    End With
    
    With cht2
    .Parent.Left = .Parent.Left + .Parent.Width / 2
    .ChartType = xlColumnClustered
    .SetSourceData rChart2
    End With
    
    End With
    
    End Sub
    Kindly find the image at http://peltiertech.com/images/2015-0...tsPartDeux.png My data set has 23 pcts and acts.

    I have also posted my question on other forums as follows:http://stackoverflow.com/questions/3...-in-vba-charts

    http://www.excelkey.com/forum/viewto...p=22008#p22008

    http://www.ozgrid.com/forum/showthre...574#post750574

    http://www.mrexcel.com/forum/excel-q...ml#post4203489

    http://stackoverflow.com/questions/3...-in-vba-charts
    Last edited by adventurer; 07-03-2015 at 04:17 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Adding 1 series of data in 234 charts were 3 series already exist
    By Joachimjr in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-10-2014, 01:56 AM
  2. =SERIES and charts (adding two cells in a series formula)
    By benmmaddog in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-11-2013, 09:52 PM
  3. Charts>Series>Values Error
    By Raman325 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2006, 01:35 PM
  4. formula too long error
    By SB in forum Excel General
    Replies: 2
    Last Post: 12-19-2005, 06:00 PM
  5. [SOLVED] line charts - error in series should not plot (empty)
    By NorTor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 12:05 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