ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dynamic graph data series (https://www.excelbanter.com/excel-programming/282771-dynamic-graph-data-series.html)

Nick Holway

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




All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com