LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
JessK
 
Posts: n/a
Default Variable series length/range

Thanks for the help with adding new series with a macro. The procedure from
the Quick Chart VBA site worked great.

Is there some other way to specify the range of cells used in a series? As
I add rows of data, I would like to group some series together (based on date
data was taken, etc). Below is what I'm currently trying. I wanted to use a
variable for the number of rows selected for the data series. Substituting
Cells( , ) for Range(" ") has worked for me in the past for general things
like Copy and Paste, but it produces an error when I use it after ActiveSheet.

Sheets("Summary").Select
same_cal = 1
10
If Range("B5").Value = Cells(5 + same_cal, 2).Value Then
Cells(5 + same_cal, 2).Select
Selection.ClearContents
same_cal = same_cal + 1
GoTo 10
End If

If same_cal 1 Then
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Cells(5, 2) -- vs. Range("B5")
.Values = ActiveSheet.Range(Cells(5, 5), Cells(5 + same_cal, 5))
--vs. Range("E5:??")
.XValues = ActiveSheet.Range(Cells(5, 1), Cells(5 + same_cal,
1)) --vs. Range("A5:??")
End With
ElseIf same_cal = 1 Then
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Range("B5")
.Values = ActiveSheet.Range("E5")
.XValues = ActiveSheet.Range("A5")
End With
End If

 
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
Chart -- Source Data... -- Series dialog window Sarah Jane Charts and Charting in Excel 2 January 24th 06 10:27 AM
Can I add an average series to a chart with 2 or more series? Yaniv Charts and Charting in Excel 4 June 16th 05 11:37 PM
Quasi Transpose / Stacking Columns Mike Excel Worksheet Functions 10 April 26th 05 08:04 PM
How to change Series order in a Combination Chart? vrk1 Charts and Charting in Excel 3 April 1st 05 07:21 AM
series graph -- one series being added to another series rich zielinski via OfficeKB.com Charts and Charting in Excel 3 March 30th 05 06:23 PM


All times are GMT +1. The time now is 08:37 AM.

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

About Us

"It's about Microsoft Excel"