John forgot the quote marks in his RenameChart macro:
Sub RenameChart()
ActiveChart.Parent.Name = "Chart1"
End Sub
Or, to rename a chart manually:
Hold the Ctrl key, and click on the chart to select it
Click in the Name Box, to the left of the formula bar
Type a new name for the chart
Press the Enter key
John Mansfield wrote:
Berthica,
These macros should help:
Sub GetChartName()
MsgBox "The chart name is: " & ActiveChart.Parent.Name
End Sub
Sub RenameChart()
ActiveChart.Parent.Name = Chart1
End Sub
----------------------------
Regards,
John Mansfield
http://www.pdbook.com
"Berthica" wrote:
I have a lot of charts in a woorkbook and need to refer to them in my VBA. I
cannot know the names (numbers) of all the charts. mHow can I change a
chart's name so it is easy to find them ?
--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html