Hi Pete,
The following Macro may help you change the name.
1. Right Click on the Icon.
2. Run the Macro (you will be prompted for a new name).
In an Ordinary Code Module Such as Module1:
Sub zzzRenameActiveShape()
'This renames the 'Active Shape' (new name is obtained via 'InputBox')
Dim sData As String
Dim sOldShapeName As String
Dim sName As String
Dim sNewShapeName As String
'Get the name of the 'Active Shape'
'Exit if there is none
On Error Resume Next
sOldShapeName = Application.Selection.name
If Err.Number <> 0 Then
MsgBox "There is no Active Shape selected."
GoTo ERROR_EXIT
End If
'Get the new 'Shape Name' (without leading and trailing BLANKS)
sData = "Enter the New Name for Shape '" & sOldShapeName & "'" & vbCrLf & _
"then Select 'OK'"
sNewShapeName = InputBox(sData, "Shape Rename")
sNewShapeName = Trim(sNewShapeName)
'Verify that the name isn't BLANK
If Len(sNewShapeName) = 0 Then
MsgBox "Nothing done. The new Name is BLANK or CANCEL was selected." & vbCrLf & _
"Try again with a name that is Unique on the Sheet."
GoTo ERROR_EXIT
End If
'Verify that the name does not already exist
'No error means the name already exists
sName = ActiveSheet.Shapes(sNewShapeName).name
If Err.Number = 0 Then
MsgBox "Nothing done. New Name '" & sNewShapeName & "' already exists." & vbCrLf & _
"Try again with a name that is Unique on the Sheet."
GoTo ERROR_EXIT
End If
'Rename the Shape
ActiveSheet.Shapes(sOldShapeName).name = sNewShapeName
'Display a Message
MsgBox "The Active Shape was renamed." & vbCrLf & _
"Old Name: '" & sOldShapeName & "'" & vbCrLf & _
"New Name: '" & sNewShapeName & "'"
ERROR_EXIT:
On Error GoTo 0
End Sub
Lewis
Bookmarks