Naming charts, PLEASE HELP! :)

ecampsite.co.uk

New Member
Joined
Dec 2, 2005
Messages
1
Hi, is there a way to name charts when I create them, Instead of it automatically naming them chart1, chart2, etc.
Ive created a macro to create a chart from some data, and Im trying to create a macro to delete the chart, but I dont want to have to select it and delete it, I want to initially call it a name when i create it, and then delete the chart with that name with the other macro. Is this possible????

Thank you,
Craig
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

birdman

Board Regular
Joined
Oct 11, 2005
Messages
187
in the first macro, after the chart is created, you can put
Code:
ActiveChart.Name = "Steve"
 

tusharm

MrExcel MVP
Joined
May 28, 2002
Messages
11,028
If the charts are embedded in a sheet you should focus on naming the parent of the chart, i.e., the chartobject that contains the chart. If the macro that creates the chart has a variable for the chart use {variable}.parent.name=...

If the chart is a chartsheet by itself use {variable}.name=...

ecampsite.co.uk said:
Hi, is there a way to name charts when I create them, Instead of it automatically naming them chart1, chart2, etc.
Ive created a macro to create a chart from some data, and Im trying to create a macro to delete the chart, but I dont want to have to select it and delete it, I want to initially call it a name when i create it, and then delete the chart with that name with the other macro. Is this possible????

Thank you,
Craig
 

Watch MrExcel Video

Forum statistics

Threads
1,118,083
Messages
5,570,124
Members
412,305
Latest member
Mozz
Top