New to VBA and not sure how to set the Chart title to a specific selected column. I am creating multiple graphs from one data sheet so want to be able to select the data and the graph to be named appropriately.
Sub Charter()
Dim my_range As Range
Set my_range = Selection
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.FullSeriesCollection(1).ChartType = xlColumnClustered
ActiveChart.FullSeriesCollection(1).AxisGroup = 1
ActiveChart.FullSeriesCollection(2).ChartType = xlLine
ActiveChart.FullSeriesCollection(2).AxisGroup = 1
ActiveChart.FullSeriesCollection(1).ChartType = xlXYScatter
ActiveChart.FullSeriesCollection(1).AxisGroup = 1
ActiveChart.SetSourceData Source:=my_range
Cells(1, 1).Select
End Sub
I want the graph title to use the data set name that is used in
ActiveChart.FullSeriesCollection(1).ChartType = xlXYScatter
Thanks