PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Re: Naming a chart

Reply

Re: Naming a chart

 
Thread Tools Rate Thread
Old 08-07-2003, 05:03 PM   #1
Jon Peltier
Guest
 
Posts: n/a
Default Re: Naming a chart


Lynn -

You have to hold down Shift while selecting the chart, so the resizing
handles are white. This means the ChartObject (the container, or
parent, for the chart) is selected; the ChartObject is the thing you
need to name. Now type a new name into the Name box, and press Enter.

In vba you would use this syntax:

ActiveChart.Parent.Name = "MyChart"

Now you refer to the ChartObject like so:

ActiveSheet.ChartObjects("MyChart")

and to the chart itself:

ActiveSheet.ChartObjects("MyChart").Chart

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Lynn wrote:
> How do I name a chart so that it may be referred to in VBA
> code? The Help documentation indicates that this may be
> done by selecting the chart and typing in the Name box.
> This did not work for me however.


  Reply With Quote
Old 08-07-2003, 05:20 PM   #2
Lynn
Guest
 
Posts: n/a
Default Re: Naming a chart

Thanks alot Jon!!

>-----Original Message-----
>Lynn -
>
>You have to hold down Shift while selecting the chart, so

the resizing
>handles are white. This means the ChartObject (the

container, or
>parent, for the chart) is selected; the ChartObject is

the thing you
>need to name. Now type a new name into the Name box, and

press Enter.
>
>In vba you would use this syntax:
>
>ActiveChart.Parent.Name = "MyChart"
>
>Now you refer to the ChartObject like so:
>
> ActiveSheet.ChartObjects("MyChart")
>
>and to the chart itself:
>
> ActiveSheet.ChartObjects("MyChart").Chart
>
>- Jon
>-------
>Jon Peltier, Microsoft Excel MVP
>http://www.geocities.com/jonpeltier/Excel/index.html
>_______
>
>Lynn wrote:
>> How do I name a chart so that it may be referred to in

VBA
>> code? The Help documentation indicates that this may be
>> done by selecting the chart and typing in the Name box.
>> This did not work for me however.

>
>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off