LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Discontiguous Chart Source

I want to create a chart with 1 serie which has data from 4 discontiguous
cells.
I defined 'b=6' but in practice it has a variable value, also counter has
variable values.
I tried two methods:
1/ with the union method to make a multirange selection
2/ by combining the cell addresses to a string.
None of these works. How do I solve this?

thanx in advance

Sub Macro1()
Charts.Add
With ActiveChart
.ChartType = xlColumnClustered
.SetSourceData Source:=Sheets("Summery").Range("A21:I40"), PlotBy:=xlRows
.SeriesCollection.NewSeries
.SeriesCollection(1).XValues = "={""x1"",""x2"",""x3"",""x4""}"

Set temprange = Range(Cells(2, b))
For counter = 4 To 8 Step 2
Set temprange = Union(temprange, Range(Cells(counter, b)))
Next
.SeriesCollection(1).Values = temprange

'tempstring = Cells(2, b).Address
'For counter = 4 To 8 Step 2
' tempstring = tempstring & "," & Cells(counter, b).Address
'Next
'.SeriesCollection(1).Values = range(tempstring)

.SeriesCollection(1).Name = "=""test"""
.Location Whe=xlLocationAsObject, Name:="Summery"
End With
End Sub

 
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
Discontiguous Chart Source Ladymuck Excel Programming 6 January 2nd 07 10:47 AM
Items in a discontiguous range [email protected] Excel Programming 2 December 1st 06 08:42 AM
Is it possible to plot discontiguous cells? Peter Bernadyne Charts and Charting in Excel 8 May 11th 06 09:45 PM
Is it possible to plot discontiguous cells? Peter Bernadyne Excel Discussion (Misc queries) 0 May 9th 06 10:32 PM
discontiguous ranges in charts Pilgrim Excel Programming 1 July 3rd 04 05:53 PM


All times are GMT +1. The time now is 02:54 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"