Hi all,
I want to programmatically add a title to a chart.
The chart is on a chart sheet (what happens when you hit F11), not on the same sheet where the data source is.
The title text is on cell A1 of the worksheet with the datasource.
Now if the data source is on the sheet "data" then this works
However I do not the sheet name (nor the position in the workbook)
I was hoping something like ActiveChart.GetSourceData exists (as opposed to ActiveChart.SetSourceData).
How can identify the worksheet where the data source of my chart is
something like
Thanks
DF
I want to programmatically add a title to a chart.
The chart is on a chart sheet (what happens when you hit F11), not on the same sheet where the data source is.
The title text is on cell A1 of the worksheet with the datasource.
Now if the data source is on the sheet "data" then this works
Code:
ActiveChart.HasTitle = True
ActiveChart.ChartTitle.Text = "=data!A1"
I was hoping something like ActiveChart.GetSourceData exists (as opposed to ActiveChart.SetSourceData).
How can identify the worksheet where the data source of my chart is
something like
Code:
mysheet = ActiveChart.GetSourceData ...
and then
ActiveChart.ChartTitle.Text = "=mysheet!A1"
Thanks
DF