Chart Object Name

  • Thread starter Thread starter LB
  • Start date Start date
L

LB

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
 
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
 
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
 
Hi Raj -

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

- Jon
 
Back
Top