Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Variable Series in graphs

I have a problem with adding series to a newly created graph in VBA
The ranges for my data need to be pulled from a variable amount of
sheets, based upon the data I am currently working with.

The array to obtain the variable values is in an array of integers
which may not be necessarily sequential.

i.e on one book I may have the integers of 1, 2, 3, 4
on another I may have 1, 2, 3, 9, 10

I am able to create the series, and chart without any problems,
however when I run my macro it gives an error of "series formula is
too long"
I checked the help, but I am not quite sure where I am going wrong
here.
below is my code, the parts that are only pertinent to making the
charts.

Set alpha_chartobj = Sheets("Alpha Face").ChartObjects.Add _
(250, 375, 75, 225)

With alpha_chartobj.Chart
.ChartType = xlLine

For Each carrier_graph In Sheets("Sheet1").Range("D2:D" &
carrier_array_upper)
With .SeriesCollection.NewSeries
.Values = Sheets("F" & carrier_graph).Range("B2:B" &
last_row_filtered)
.Name = "F" & carrier_graph
End With
Next
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Variable Series in graphs

On Dec 17, 5:15 pm, wrote:
I have a problem with adding series to a newly created graph in VBA
The ranges for my data need to be pulled from a variable amount of
sheets, based upon the data I am currently working with.

The array to obtain the variable values is in an array of integers
which may not be necessarily sequential.

i.e on one book I may have the integers of 1, 2, 3, 4
on another I may have 1, 2, 3, 9, 10

I am able to create the series, and chart without any problems,
however when I run my macro it gives an error of "series formula is
too long"
I checked the help, but I am not quite sure where I am going wrong
here.
below is my code, the parts that are only pertinent to making the
charts.

Set alpha_chartobj = Sheets("Alpha Face").ChartObjects.Add _
(250, 375, 75, 225)

With alpha_chartobj.Chart
.ChartType = xlLine

For Each carrier_graph In Sheets("Sheet1").Range("D2:D" &
carrier_array_upper)
With .SeriesCollection.NewSeries
.Values = Sheets("F" & carrier_graph).Range("B2:B" &
last_row_filtered)
.Name = "F" & carrier_graph
End With
Next
End With


Sorry I forgot to mention the error "Series Formula is too long"
occurs on the line:

Set alpha_chartobj = Sheets("Alpha Face").ChartObjects.Add _
(250, 375, 75, 225)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to give range names (especially with relative reference) for series names and series values in Excel 2007 graphs? [email protected] Excel Programming 0 August 16th 07 02:52 PM
HELP- Copy a Data Series to Other Graphs? phil6666 Excel Discussion (Misc queries) 0 February 9th 05 04:03 PM
HELP- Copy a Data Series to Other Graphs? phil6666 Excel Discussion (Misc queries) 0 February 9th 05 04:02 PM
HELP- Copy a Data Series to Other Graphs? phil6666 Excel Discussion (Misc queries) 0 February 9th 05 03:55 PM
HELP- Copy a Data Series to Other Graphs? phil6666 Excel Discussion (Misc queries) 0 February 2nd 05 05:48 AM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"