Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default FOR loop macro

Error:
Unable to set the value propoerty of the series class

Please help me fix this error? Thanks

The code I use is

sub chart ()

Charts.Add


ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A45:F63000"), PlotBy:= _
xlColumns


For i = 1 To 10
j = ((i - 1) * 524) + 46
k = j + 523


ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here
ActiveChart.SeriesCollection(i).Name = "=Sheet1'!R(" & j & ")C2"


Next

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default FOR loop macro

ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here


I've not worked with charts myself, so this is just a guess... but shouldn't
the .Values in the above line be .XValues (or maybe .YValues) like in the
line above it?

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default FOR loop macro

Try taking out the parentheses (if it works, do the same thing on the next
line)

ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R" & j & "C1:R" & k &
"C1"

HTH,

wrote in message
ps.com...
Error:
Unable to set the value propoerty of the series class

Please help me fix this error? Thanks

The code I use is

sub chart ()

Charts.Add


ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A45:F63000"), PlotBy:= _
xlColumns


For i = 1 To 10
j = ((i - 1) * 524) + 46
k = j + 523


ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here
ActiveChart.SeriesCollection(i).Name = "=Sheet1'!R(" & j & ")C2"


Next



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default FOR loop macro

On Oct 19, 2:19 pm, "Rick Rothstein \(MVP - VB\)"
wrote:
ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here


I've not worked with charts myself, so this is just a guess... but shouldn't
the .Values in the above line be .XValues (or maybe .YValues) like in the
line above it?

Rick


No it is .values

Even the macro recorder returns it as .values and .xvalues

This makes sense because for a X-Y scatter plot if .xvalues are
declared, then .values automatically refer to y ones.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default FOR loop macro

On Oct 19, 2:21 pm, "George Nicholson"
wrote:
Try taking out the parentheses (if it works, do the same thing on the next
line)

ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R" & j & "C1:R" & k &
"C1"

HTH,

wrote in message

ps.com...



Error:
Unable to set the value propoerty of the series class


Please help me fix this error? Thanks


The code I use is


sub chart ()


Charts.Add


ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A45:F63000"), PlotBy:= _
xlColumns


For i = 1 To 10
j = ((i - 1) * 524) + 46
k = j + 523


ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here
ActiveChart.SeriesCollection(i).Name = "=Sheet1'!R(" & j & ")C2"


Next- Hide quoted text -


- Show quoted text -


George, It doesnt work :(



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default FOR loop macro

George was right, you need to remove the parentheses from both lines of code.
But as well as that, in your .Name line, you are missing an apostrophe
between = and Sheet1.

" wrote:

On Oct 19, 2:21 pm, "George Nicholson"
wrote:
Try taking out the parentheses (if it works, do the same thing on the next
line)

ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R" & j & "C1:R" & k &
"C1"

HTH,

wrote in message

ps.com...



Error:
Unable to set the value propoerty of the series class


Please help me fix this error? Thanks


The code I use is


sub chart ()


Charts.Add


ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A45:F63000"), PlotBy:= _
xlColumns


For i = 1 To 10
j = ((i - 1) * 524) + 46
k = j + 523


ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i).XValues = "='Sheet1'!
R46C3:R569C3"
ActiveChart.SeriesCollection(i).Values = "='Sheet1'!R(" & j &
")C1:R(" & k & ")C1" '''''''''''' Error here
ActiveChart.SeriesCollection(i).Name = "=Sheet1'!R(" & j & ")C2"


Next- Hide quoted text -


- Show quoted text -


George, It doesnt work :(


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
Do until loop with use of another macro in loop The Excelerator Excel Programming 9 February 28th 07 02:28 AM
how can i loop a macro Remote help Excel Discussion (Misc queries) 1 July 21st 05 02:57 AM
loop macro cacique Excel Programming 7 July 3rd 05 02:59 PM
Loop a macro Steve[_71_] Excel Programming 3 February 9th 05 04:15 PM
VBA Macro Loop Neutron1871 Excel Programming 1 November 4th 04 09:22 AM


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