Dear community
My name is Giacomo and you can consider me an Excel-VBA dummy.
I'm trying to learn VBA and in the meantime I have problem also with naming my chart.
This is the list I wrote to prduce a little chart.
Sub grafico()
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
WS.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:= WS.Range("F6:F9")
ActiveChart.ChartType = xlXYScatter
End Sub
It works good, but I would like to put the title on top.
I tryied with
ActiveChart.ChartTitle.Caption = "My Chart"
or
ActiveChart.ChartTitle.Text = "My Chart"
but both my attempts don't work.
Any suggestions?
Thank you very much
My name is Giacomo and you can consider me an Excel-VBA dummy.
I'm trying to learn VBA and in the meantime I have problem also with naming my chart.
This is the list I wrote to prduce a little chart.
Sub grafico()
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
WS.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:= WS.Range("F6:F9")
ActiveChart.ChartType = xlXYScatter
End Sub
It works good, but I would like to put the title on top.
I tryied with
ActiveChart.ChartTitle.Caption = "My Chart"
or
ActiveChart.ChartTitle.Text = "My Chart"
but both my attempts don't work.
Any suggestions?
Thank you very much