To those who might help me:
I am new to programming macros and am learing painfully by experience. I have set up a macro to extract data into a chart, but found that in order to use the macro successfully I had to re-name the chart such that Excel's natural sequential naming process does not interfere. I have read up on some of the forums on how to do this, and have attempted several times, however it trips the debugger every time. I have also tried to apply a title to the chart, and was summarily foiled as well. I am uncertain what I am doing incorrectly, and I would be greatly appreciative of any responses and aid you might offer!
Sub Macro2() ' ' Macro2 Macro ' ' Range("N3:O55").Select ActiveWindow.SmallScroll Down:=-39 ActiveSheet.Shapes.AddChart.Select ActiveChart.SetSourceData Source:=Range("'Sheet2'!$N$3:$O$55") ActiveChart.Name = "BRI" ActiveChart.ChartType = xlLine ActiveChart.Legend.Select Selection.Delete ActiveChart.ChartTitle.Caption = "Weekly Management Support" End Sub
Last edited by IowaIrishman; 01-10-2012 at 11:13 AM.
You need to set the name of the parent object.
You need to add a title before you can set the text.
Sub Macro2() ' ' Macro2 Macro ' ' Range("N3:O55").Select ActiveWindow.SmallScroll Down:=-39 ActiveSheet.Shapes.AddChart.Select ActiveChart.SetSourceData Source:=Range("'Sheet2'!$N$3:$O$55") ActiveChart.Parent.Name = "BRI" ActiveChart.ChartType = xlLine ActiveChart.Legend.Select Selection.Delete ActiveChart.HasTitle = True ActiveChart.ChartTitle.Caption = "Weekly Management Support" End Sub
Thanks Andy! I'm learning slowly by degrees. I appreciate your time helping me out!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks