Hi All. I have searched through tonnes of webpages but yet to find a solution to my idea. Can someone here assist me?
To put it simply, say, I have x-columns of data. With a mouse click of the macro, I can generate x-series graphs out of these x-columns of data. Eg. If I have 10 columns of data, I will have 10 graphs. If I have 20 columns of data, I will have 20 graphs.
Also, each graph will plot till the last cell (that has value) of the column.
Thanks.
Last edited by keile; 07-29-2009 at 12:46 AM.
Code:Sub X() Dim rngData As Range Dim rngColumn As Range Dim chtTemp As ChartObject Dim sngTop As Single Dim sngHeight As Single sngHeight = 150 For Each rngColumn In Range("A1").CurrentRegion.Columns Set rngData = rngColumn.Range("A1", rngColumn.Range("A1").End(xlDown)) Set chtTemp = ActiveSheet.ChartObjects.Add(1, sngTop, 200, sngHeight) With chtTemp.Chart.SeriesCollection.NewSeries .Name = rngData.Cells(1, 1) .Values = rngData.Offset(1, 0).Resize(rngData.Rows.Count - 1, 1) End With sngTop = sngTop + sngHeight Next End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks