Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning data source to chart
Set the Values and XValues properties to be the actual
range object, not a formula - for you this is complicated by the fact that you can't use R1C1 notation for the range address, but this should work: ActiveChart.SeriesCollection(ColNum).XValues = ActiveSheet.Range(ActiveSheet.Cells(i + 1,2),ActiveSheet.Cells(i + 1,10)) etc... -----Original Message----- I am trying to add a number of data series to a chart however I get an error (object doesn't support this property or method) when running this piece of code. Dim Cname, i, ColNum Cname = "Cht-" & ActiveSheet.Name Charts.add.Name = Cname ActiveChart.ChartType = xlXYScatter ColNum = 1 i = 3 Do Until ActiveSheet.Range("A" & i) = "" ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(ColNum).XValues = "=" & ActiveSheet.Name & _ "!R" & i + 1 & "C2:R" & i + 1 & "C10" ActiveChart.SeriesCollection(ColNum).Values = "=" & ActiveSheet.Name & _ "!R" & i + 2 & "C2:R" & i + 2 & "C10" ActiveChart.SeriesCollection(ColNum).Name = "=" & ActiveSheet.Name & _ "!R" & i & "C1" i = i + 6 ColNum = ColNum + 1 Loop ActiveChart.Location Whe=xlLocationAsObject, Name:=ActiveSheet.Name It might not be the right way to do this so any suggestions are welcome. Thanks The Doctor . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assigning A Value Axis to a Data Series in a Combination Chart | Setting up and Configuration of Excel | |||
pie chart & column chart w/same source data | Charts and Charting in Excel | |||
Use detailed data in one worksheet to create summary data as chart source | Charts and Charting in Excel | |||
How do you link chart source data when you copy the chart? | Charts and Charting in Excel | |||
Update a chart immediately after inputting data into data source | Charts and Charting in Excel |