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: 115
Default How to add series to a chart using a macro

I am getting the following error for executing this code

Unable to get the chart object property of the worksheet class

Please help me solve the problem.

I am trying to add 240 series to a chart. If someone can help to add
10 series then I will tweak the code for 240 series. Please help.

Code:

Dim mySeries As Series
For i = 6 To 240
j = ((i - 3) * 524) + 46
k = j + 523


Set mySeries = Sheets("Sheet1").ChartObjects("Chart1"). _
Chart.SeriesCollection.NewSeries


mySeries.SeriesCollection(i).XValues = "='Sheet1'!R46C3:R569C3"
mySeries.ChartObjects("Chart 1").SeriesCollection(i).Values =
"='Sheet1'!R(j)C1:R(k)C1"
mySeries.ChartObjects("Chart 1").SeriesCollection(i).Name =
"='Sheet1'!R(j)C2"

Next

 
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
macro to change series xvalues in chart alligatormaki Excel Programming 1 March 2nd 07 11:59 PM
Expand Chart Macro to Plot Multiple Series [email protected] Excel Programming 0 July 19th 06 03:02 PM
Use a macro to expand data series for chart? Kevin Clark Charts and Charting in Excel 0 June 21st 06 07:31 PM
Adding data series to chart via macro JessK Charts and Charting in Excel 1 March 1st 06 11:04 PM
how to turn of a series in data sheet of a power point chart using macro chepyalarr Excel Programming 1 February 2nd 06 07:06 PM


All times are GMT +1. The time now is 11:13 PM.

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"