PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting Chart Object Name

Reply

Chart Object Name

 
Thread Tools Rate Thread
Old 22-09-2003, 07:46 PM   #1
LB
Guest
 
Posts: n/a
Default Chart Object Name


Excel assigns a name to each new chart object on a
worksheet as they are created (Chart 1, Chart 2, ...).
If a chart is deleted the next chart created is assigned
the next sequential number, so if the last chart built
was "Chart 7" and you delete it and add another chart, the
next chart is assigned "Chart 8." I would like to
rename "Chart 8" to "Chart 7." Is there any way to
accomplish this?

Thanks,

LB
  Reply With Quote
Old 22-09-2003, 10:10 PM   #2
Debra Dalgleish
Guest
 
Posts: n/a
Default Re: Chart Object Name

To manually rename a chart object:

1. Hold the Ctrl key, and click on the chart to select it
2. Click in the Name box, to the left of the formula bar
3. Type a new name, or edit the existing name
4. Press the Enter key

LB wrote:
> Excel assigns a name to each new chart object on a
> worksheet as they are created (Chart 1, Chart 2, ...).
> If a chart is deleted the next chart created is assigned
> the next sequential number, so if the last chart built
> was "Chart 7" and you delete it and add another chart, the
> next chart is assigned "Chart 8." I would like to
> rename "Chart 8" to "Chart 7." Is there any way to
> accomplish this?


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  Reply With Quote
Old 22-09-2003, 11:12 PM   #3
Raj Singh
Guest
 
Posts: n/a
Default Re: Chart Object Name

Hello,

I know how to do this using vba:

Sub renameChart()

ActiveChart.Parent.Name = "Chart 7"

End Sub

Highlight the chart in question and run this code.

HTH,
Raj

AnalysisWorks Inc
Evidence-Based Analytic Consulting
www.analysisworks.net

Download a free Excel Box Plot add-in:
http://www.analysisworks.net/downloads.htm#BoxPlotPro

"LB" <lb1959@txmail.sbc.com> wrote in message news:<0fb701c38139$e38e0400$a001280a@phx.gbl>...
> Excel assigns a name to each new chart object on a
> worksheet as they are created (Chart 1, Chart 2, ...).
> If a chart is deleted the next chart created is assigned
> the next sequential number, so if the last chart built
> was "Chart 7" and you delete it and add another chart, the
> next chart is assigned "Chart 8." I would like to
> rename "Chart 8" to "Chart 7." Is there any way to
> accomplish this?
>
> Thanks,
>
> LB

  Reply With Quote
Old 22-09-2003, 11:28 PM   #4
Raj Singh
Guest
 
Posts: n/a
Default Re: Chart Object Name

Sorry, I missed a part in the vba code I sent you. It should be this:

Sub renameChart()

Dim nm As String

nm = ActiveSheet.Name

ActiveChart.Parent.Name = "Chart 7"

ActiveSheet.Name = nm

End Sub

HTH,
Raj

"LB" <lb1959@txmail.sbc.com> wrote in message news:<0fb701c38139$e38e0400$a001280a@phx.gbl>...
> Excel assigns a name to each new chart object on a
> worksheet as they are created (Chart 1, Chart 2, ...).
> If a chart is deleted the next chart created is assigned
> the next sequential number, so if the last chart built
> was "Chart 7" and you delete it and add another chart, the
> next chart is assigned "Chart 8." I would like to
> rename "Chart 8" to "Chart 7." Is there any way to
> accomplish this?
>
> Thanks,
>
> LB

  Reply With Quote
Old 26-09-2003, 11:27 PM   #5
Jon Peltier
Guest
 
Posts: n/a
Default Re: Chart Object Name

Hi Raj -

Actually, your first one was fine. The extra lines seem to serve no
purpose.

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

Raj Singh wrote:
> Sorry, I missed a part in the vba code I sent you. It should be this:
>
> Sub renameChart()
>
> Dim nm As String
>
> nm = ActiveSheet.Name
>
> ActiveChart.Parent.Name = "Chart 7"
>
> ActiveSheet.Name = nm
>
> End Sub
>
> HTH,
> Raj
>
> "LB" <lb1959@txmail.sbc.com> wrote in message news:<0fb701c38139$e38e0400$a001280a@phx.gbl>...
>
>>Excel assigns a name to each new chart object on a
>>worksheet as they are created (Chart 1, Chart 2, ...).
>>If a chart is deleted the next chart created is assigned
>>the next sequential number, so if the last chart built
>>was "Chart 7" and you delete it and add another chart, the
>>next chart is assigned "Chart 8." I would like to
>>rename "Chart 8" to "Chart 7." Is there any way to
>>accomplish this?
>>
>>Thanks,
>>
>>LB

>


  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