View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nick Holway Nick Holway is offline
external usenet poster
 
Posts: 2
Default dynamic graph data series


Hi,

I'm trying to write a macro which creates a scatter plot with 16 data series
on the Y axis, each from an adjacent column. The data on the Y axis is of
variable length and starts in row 29, the first column with data is 8. I'm
trying to use xlDown to find the end. The X axis is a counter. My problem is
I can't seem to get the loop to move though the columns finding the end of
the data.

This is what I've come up with:

For i = 1 To 16

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(i).XValues = i
ActiveChart.SeriesCollection(i).Values = Range(Cells(29, i + 7),
Cells(End(xlDown), i + 7))
ActiveChart.SeriesCollection(i).Name = "=ratios!R3C2"

Next i


Thanks in advance for any help.

Nick Holway