XYscatter chart source

G

Guest

I am trying to set the x & y source data ranges for a SYScatter chart in VBA.
I use the following code to create the chart, but the x values are not used
for the x-axis (the automatic x-axis is 1,2,3...n).
ActiveChart.SetSourceData Source:=ActiveSheet.Range(Y_rngStr), _
PlotBy:=xlColumns
With ActiveSheet.ChartObjects(1).Chart
.ChartType = xlXYScatter
I have tried everything I can think of and variations of previous newsgroup
questions/answers without success. Any suggestions would be appreciated!
 
M

Mike Middleton

Mitch -

It might be helpful to know exactly what you have tried, and it might be
helpful to provide a longer snippet of your code, etc.

For example, even if your code is OK, if any of the cells in the X range are
text instead of numbers, Excel uses 1,2,3,... for the X values.

- Mike
http://www.mikemiddleton.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top