Dear Excel experts,
So far I have found this forum incredibly helpful as I am new to excel/VBA, so I hope you can help me once more!
I have found this very well written macro on http://www.excelforum.com/excel-char...te-graphs.html, and I copied it below.
I have modified one line so to have it running on a selection of data but I am still struggling to do the following:
1/ I want to create a separate sheet where all the graphs are stored rather than having a sheet for each graph
2/ The single charts are time series graphs so they all have the same interval range on the X-axis and one single series of values...how do I instruct excel to understand that?
3/ I want to apply my ad-hoc graphical template to each chart (template already saved and ready)
Can someone tell me how to modify the code below to incorporate 1-3? Thanks soooooo much!
---------------------------------
Sub OneChartPerRow()
Dim rCat As Range
Dim rVal As Range
Dim rUsed As Range
Dim iRow As Long
Dim cht As Chart
Set rUsed = Selection
Set rCat = rUsed.Rows(1)
For iRow = 2 To rUsed.Rows.Count
Set rVal = rUsed.Rows(iRow)
Set cht = Charts.Add
cht.Name = rVal.Cells(1, 1)
With cht
.SetSourceData Source:=Union(rCat, rVal)
.HasTitle = False
.HasTitle = True
With .ChartTitle
.Text = rVal.Cells(1, 1)
End With
End With
Next
End Sub
Moderator's note: Added code tags and corrected typo in thread title
Bookmarks