Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Setting chart Xvalue errors

The limit is not 10. It depends on the length of the string used to define
the range. His code falls down for other reasons.

Your examples put the values of the indicated cells into a string array,
without preserving links to the original cells. This is fine if the chart is
a one-off and you don't worry about data changing.

The only way inserting a space and a close parenthesis into your string
would work is if the string were somehow missing these characters. The last
line you suggest fails, but this doesn't fail:

activechart.SeriesCollection(1).XValues =
"$H$1,$J$1,$L$1,$N$1,$P$1,$R$1,$T$1,$V$1,$X$1"

It doesn't do as desired, however, as it uses the cell addresses in the
string array, not the values in the cells, as the labels for the category
axis. It converts the entry in the Category Labels box of the Source Data -
Series dialog into exactly what Robert posted.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Greg Glynn" wrote in message
oups.com...
Robert,

I've struck this problem before also. I think there is limit of 10
ranges you can nominate, so check that first. Your code ={"$H$1","$J
$1","$L$1","$N$1","$P$1","$R$1","$T$1","$V$1","$X$ 1"} only has 9, so
it's probably OK.

The code that worked for me was:

myxvalues = myxvalues & Cells(1, (x * 4)).Value & ","

ActiveChart.SeriesCollection(1).XValues = " " & myxvalues & ")"

That's right! A LEADING SPACE and a TRAILING )

(Don't ask me why it works though).

So try .SeriesCollection(1).XValues = " " & "$H$1","$J$1","$L$1","$N
$1","$P$1","$R$1","$T$1","$V$1","$X$1" & ")"

Let me know how you go.



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
2graph with the same Xvalue and same Size of graph c06 Charts and Charting in Excel 1 April 10th 06 03:47 PM
Charts with Xvalue and YValue? deko[_2_] Excel Programming 2 March 8th 05 08:34 AM
How to get corresponding Xvalue for specific Yvalue from XYScatte. azmodeus Charts and Charting in Excel 5 January 16th 05 02:45 PM
InitializeComponent() errors, Setting values in another form Jeff Morhous Excel Programming 1 February 9th 04 12:13 PM
vc++ automation: opening chart as chart window and setting scale Mike Biolsi Excel Programming 0 February 7th 04 08:13 AM


All times are GMT +1. The time now is 05:31 PM.

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"