How can I change the name of the chart ?

  • Thread starter Thread starter Aalt van 't Pad
  • Start date Start date
A

Aalt van 't Pad

L.S.,

Normaly a new chart gets the name "Chart 1". I want to
change it in a another name. How can I change it with
normal Excel functionality and how can I change it with VBA ?

Thanks,
Aalt
 
A chart embedded in a worksheet is actually contained in the
chartobject container. It is usually more useful to change the
container's name.

To get the requisite VBA code, turn on the macro recorder (Tools |
Macro > Record new macro... do the below stuff and turn off the
recorder.

Click in any cell in the worksheet. Then SHIFT+click on the chart of
interest. The name box (extreme left side of the formula bar) will
show you the chartobject's current name. Click in the name box, type
in the desired name and press the ENTER key.

Now, to access the chart use
Activesheet.Chartobjects("{new name}").Chart
or
Worksheets("{worksheet name}").Chartobjects("{new name}").Chart

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
-----Original Message-----
A chart embedded in a worksheet is actually contained in the
chartobject container. It is usually more useful to change the
container's name.

To get the requisite VBA code, turn on the macro recorder (Tools |
Macro > Record new macro... do the below stuff and turn off the
recorder.

Click in any cell in the worksheet. Then SHIFT+click on the chart of
interest. The name box (extreme left side of the formula bar) will
show you the chartobject's current name. Click in the name box, type
in the desired name and press the ENTER key.

Now, to access the chart use
Activesheet.Chartobjects("{new name}").Chart
or
Worksheets("{worksheet name}").Chartobjects("{new name}").Chart

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions


.
Thank You very much for the solution.
Aalt
 
Back
Top