#1   Report Post  
Posted to microsoft.public.excel.programming
GC GC is offline
external usenet poster
 
Posts: 18
Default Help

Hello,
I am trying to set the series of 4 different charts with data from 4
seperate sheets. My sheets are called S1, S2, S3 and S4.
In the example below, I want to substitute the 1 with the variable Count.
What would be the correct syntax.

ActiveChart.SeriesCollection(1).Values = "='S1'!R2C16:R37C16"
Next

I have tried the following:
ActiveChart.SeriesCollection(1).Values = "='S"& Count"'!R2C16:R37C16"
and many variations of this. Can't seem to get it right.

Cheers,
Gerry


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,389
Default Help

You need another ampersand:
"='S"& Count & "'!R2C16:R37C16"

Regards,
Fred

"GC" wrote in message
...
Hello,
I am trying to set the series of 4 different charts with data from 4
seperate sheets. My sheets are called S1, S2, S3 and S4.
In the example below, I want to substitute the 1 with the variable Count.
What would be the correct syntax.

ActiveChart.SeriesCollection(1).Values = "='S1'!R2C16:R37C16"
Next

I have tried the following:
ActiveChart.SeriesCollection(1).Values = "='S"& Count"'!R2C16:R37C16"
and many variations of this. Can't seem to get it right.

Cheers,
Gerry


  #3   Report Post  
Posted to microsoft.public.excel.programming
GC GC is offline
external usenet poster
 
Posts: 18
Default Help

Thanks Fred! Have a great and happy New Year.

Gerry
"Fred Smith" wrote in message
...
You need another ampersand:
"='S"& Count & "'!R2C16:R37C16"

Regards,
Fred

"GC" wrote in message
...
Hello,
I am trying to set the series of 4 different charts with data from 4
seperate sheets. My sheets are called S1, S2, S3 and S4.
In the example below, I want to substitute the 1 with the variable Count.
What would be the correct syntax.

ActiveChart.SeriesCollection(1).Values = "='S1'!R2C16:R37C16"
Next

I have tried the following:
ActiveChart.SeriesCollection(1).Values = "='S"& Count"'!R2C16:R37C16"
and many variations of this. Can't seem to get it right.

Cheers,
Gerry




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,389
Default Help

Glad to help. Thanks for the feedback.

Fred.

"GC" wrote in message
...
Thanks Fred! Have a great and happy New Year.

Gerry
"Fred Smith" wrote in message
...
You need another ampersand:
"='S"& Count & "'!R2C16:R37C16"

Regards,
Fred

"GC" wrote in message
...
Hello,
I am trying to set the series of 4 different charts with data from 4
seperate sheets. My sheets are called S1, S2, S3 and S4.
In the example below, I want to substitute the 1 with the variable
Count. What would be the correct syntax.

ActiveChart.SeriesCollection(1).Values = "='S1'!R2C16:R37C16"
Next

I have tried the following:
ActiveChart.SeriesCollection(1).Values = "='S"& Count"'!R2C16:R37C16"
and many variations of this. Can't seem to get it right.

Cheers,
Gerry





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



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