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" wrote in message ...
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