Shawn_archer
New Member
- Joined
- Mar 19, 2011
- Messages
- 5
My first post here….I have recorded a macro that could generate a simple trendline chart and I want it make generic so that it can generate charts for a dynamic set of data in a single sheet.
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Time"""
ActiveChart.SeriesCollection(1).Values = "=Data!$A$2:$A$16"
ActiveChart.SeriesCollection(1).XValues = "=Data!$B$2:$B$16"
Sample data:
Col A ColB
A 10
B 14
C 26
D 27
E 17
F 24
1<sup>st</sup> chart should generate Trendline for A,B,C and 2<sup>nd</sup> chart should generate D,E,F. My Data type & Columns will remain the same, only that i require that charts ranges are to be dynamic.
Your assistance on this would be a great help for me .. Thanks!!
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""Time"""
ActiveChart.SeriesCollection(1).Values = "=Data!$A$2:$A$16"
ActiveChart.SeriesCollection(1).XValues = "=Data!$B$2:$B$16"
Sample data:
Col A ColB
A 10
B 14
C 26
D 27
E 17
F 24
1<sup>st</sup> chart should generate Trendline for A,B,C and 2<sup>nd</sup> chart should generate D,E,F. My Data type & Columns will remain the same, only that i require that charts ranges are to be dynamic.
Your assistance on this would be a great help for me .. Thanks!!