Hi all --
This seems like a really simple task, but I've looked all over and I can't find anything about it. I'm creating a series of charts in a number of Excel sheets, working fine so far. I then need to make three series. The first using X values from A13:A3000 and Y Values from B13:B3000. I can get the X Values set fine. But for the life of me I don't know how to set Y Values. Code below.
Any help is immensely appreciated. I've been working at this for days on and off. And if anyone can tell me how to relocate the chart within the sheet (eg by pixels, etc) that would also be great.Code:Dim shtData As Worksheet Set shtData = oExcel.Sheets("Layer " & N) shtData.Activate Charts.Add ActiveChart.ChartType = xlXYScatterLines ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection.NewSeries ActiveChart.SeriesCollection(1).Name = "Raw" ActiveChart.SeriesCollection(1).XValues = _ Worksheets("Layer " & N).Range("A13:A3000") ActiveChart.SeriesCollection(1).Values = _ Worksheets("Layer " & N).Range("B13:B3000") ActiveChart.SeriesCollection(2).Name = "Trans" ActiveChart.SeriesCollection(2).XValues = _ Worksheets("Layer " & N).Range("A13:A3000") ActiveChart.SeriesCollection(2).Values = _ Worksheets("Layer " & N).Range("D13:D3000") ActiveChart.SeriesCollection(3).Name = "Cos" ActiveChart.SeriesCollection(3).XValues = _ Worksheets("Layer " & N).Range("A13:A3000") ActiveChart.SeriesCollection(3).Values = _ Worksheets("Layer " & N).Range("J13:J3000")




Reply With Quote
