Hi Girish,
I assume you would like to add chart/shape and name it with specific naming convention like MyChart1, MyChart2, or MyShape1, MyShape2 etc., whereby if the name of the chart/shape is starting with "My" then we can assume safely that it has been renamed by you.
Now having said that, try the following code:
dim iCounter as Integer
For Each pic In ActiveSheet.Shapes
iCounter = iCounter + 1
'code to check if the chart/shape is already renamed or no
IF VBA.InStr(1, pic.Name, "My") = 0
' True indicates the chart/shape's name was not starting with "My"
' You can rename to your naming convention
pic.name = "MyShape" & iCounter
End If
Next pic
Hope this solves your issue.
Regards,
Prasad DN.
PS: For Each pic In ActiveSheet.Shapes code traverses all shapes in the worksheet like chart, shapes, cliparts and wordart