josephemery
01-29-2006, 08:28 PM
Hey,
Hopefully some one can figure it out. I have gotten data from a server and separate to different sheets based on value. Each sheet has between 4 and 10 set of data that I need to graph. I recorded a Marco to get a idea how to graph it. I can use the macro but i would have to rewrite the code ten times and would make it clutter. I am trying to figure a way to loop through the data, But the way i select the data to graph will not work. well here it is my code for now
Charts.Add
ActiveChart.charttype = xlLine
ActiveChart.SetSourceData Source:=Sheets("sheet").Range("F12")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Sheets("sheet").Range("d3:d200")
ActiveChart.SeriesCollection(1).Values = Sheets("sheet").Range("e3:e200")
ActiveChart.SeriesCollection(1).Name = 'graph Name"
ActiveChart.Location Where:=xlLocationAsObject, Name:="sheet"
i think i need to select the range different i tried to look around but i found a couple site and they selected the range by "!R4C3: R4C200" I try to this but VBA wouldnt accept it. I was hoping to use the R4C3 method since i could us a variable to loop through the different data sets.
Thanks for any isights or links to the apporite spots. later
Hopefully some one can figure it out. I have gotten data from a server and separate to different sheets based on value. Each sheet has between 4 and 10 set of data that I need to graph. I recorded a Marco to get a idea how to graph it. I can use the macro but i would have to rewrite the code ten times and would make it clutter. I am trying to figure a way to loop through the data, But the way i select the data to graph will not work. well here it is my code for now
Charts.Add
ActiveChart.charttype = xlLine
ActiveChart.SetSourceData Source:=Sheets("sheet").Range("F12")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Sheets("sheet").Range("d3:d200")
ActiveChart.SeriesCollection(1).Values = Sheets("sheet").Range("e3:e200")
ActiveChart.SeriesCollection(1).Name = 'graph Name"
ActiveChart.Location Where:=xlLocationAsObject, Name:="sheet"
i think i need to select the range different i tried to look around but i found a couple site and they selected the range by "!R4C3: R4C200" I try to this but VBA wouldnt accept it. I was hoping to use the R4C3 method since i could us a variable to loop through the different data sets.
Thanks for any isights or links to the apporite spots. later