Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Specify location of X Values

I am using the following code to build HLC Stock plots for
discontinuous ranges of data. There are 4 ranges plotted and 4 ranges
that are the X value labels. I am successful in referencing each
range and using them to designate the chart source data. But when I
use the Title ranges to set the XValues I get the address string (ie.
$F$6) and not the value in F6. I tried replacing SizeTitle.Address
with SizeTitle.Value (and all remaining Title ranges). This puts the
cell values as XValues, but in the reverse order.

I think the problem is that the XValues needs an array. As the code
is now, sXVal looks like "$F$6,$K$6,$N$6,$R$6" which is an array.

Dim sChartInput As String
Dim s As Series
Dim sXVal As String

sChartInput = SizeRange.Address & "," & MOTRange.Address & _
"," & TOYRange.Address & "," & TIQRange.Address

sXVal = SizeTitle.Address & "," & MOTTitle.Address & _
"," & TOYTitle.Address & "," & TIQTitle.Address

Charts.Add

ActiveChart.SetSourceData
Source:=Sheets("Drainage").Range(sChartInput), PlotBy:=xlRows

For Each s In ActiveChart.SeriesCollection
s.XValues = sXVal
Next s


Thanks for any help,
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Specify location of X Values

I might try a range variable:

Dim rXVal as Range
rXVal = union(SizeTitle, MOTTitle, TOYTitle, TIQTitle)
s.XValues = rXVal

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


wrote in message
oups.com...
I am using the following code to build HLC Stock plots for
discontinuous ranges of data. There are 4 ranges plotted and 4 ranges
that are the X value labels. I am successful in referencing each
range and using them to designate the chart source data. But when I
use the Title ranges to set the XValues I get the address string (ie.
$F$6) and not the value in F6. I tried replacing SizeTitle.Address
with SizeTitle.Value (and all remaining Title ranges). This puts the
cell values as XValues, but in the reverse order.

I think the problem is that the XValues needs an array. As the code
is now, sXVal looks like "$F$6,$K$6,$N$6,$R$6" which is an array.

Dim sChartInput As String
Dim s As Series
Dim sXVal As String

sChartInput = SizeRange.Address & "," & MOTRange.Address & _
"," & TOYRange.Address & "," & TIQRange.Address

sXVal = SizeTitle.Address & "," & MOTTitle.Address & _
"," & TOYTitle.Address & "," & TIQTitle.Address

Charts.Add

ActiveChart.SetSourceData
Source:=Sheets("Drainage").Range(sChartInput), PlotBy:=xlRows

For Each s In ActiveChart.SeriesCollection
s.XValues = sXVal
Next s


Thanks for any help,
John



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
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
Sum up values from a list to a second location. James Excel Discussion (Misc queries) 2 February 5th 08 10:29 PM
Lock shape location to axis values? William DeLeo Charts and Charting in Excel 2 December 29th 05 01:09 PM
Mouse Location, Movement and Spreadsheet Location TCook Excel Programming 3 October 3rd 05 10:23 PM
macro for paste special values in different location Das S.K Excel Programming 1 July 18th 05 01:28 PM


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