Finding Shape names?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,
this is probably really simple but I now starting to get really feed up with it,
I have a load of shapes with names and I want to rename them now I know you can click on them but lots oof these shapes are on top of each other so it takes ages click sending to back and so on just to get to a shape to name it,

is there a place in excel that has the shapes all listed that I can edit from?

if so how do I find it?

thanks

Tony
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi,

I think if you know the name of a shape you can enter it into the Name Box and over-type it.

If you don't know the name then you will have to select it.

You could have a macro that listed all the names on a worksheet. You could then enter your preferred name alongside and have another macro to make the changes.

Thinking about it, you might like something like this:
Code:
Sub ShapeRename()

    Dim ws As Worksheet
    Dim sh As Shape
    Dim newName As Variant

    Set ws = ThisWorkbook.Worksheets("Sheet1")

    With ws

        For Each sh In .Shapes
            sh.Select
            ws.Activate
            newName = Application.InputBox(Prompt:="Enter new name for shape: " & sh.Name, Title:="Change Shape Names", Type:=2)
            If newName = "" Then Exit Sub
            sh.Name = newName
        Next

    End With

End Sub
The code needs to be pasted into a new Module.
The worksheet name is currently Sheet1 but can be overtyped.

It loops through the shapes on a worksheet.
It selects it so you can see which it is then prompts for a new name while quoting the old one.
If you enter a valid one it will change it.
Entering a null response will end the macro.
 
Upvote 0
Hi Rickxl

That is brilliant, it will do exactly as I want,
massive thank you once again for your time and your help this will solve my problem

Thanks

Tony
 
Upvote 0
No problem - all part of the excellent MrExcel service :)

You were lucky, as I was writing the reply I had one of those "Hey, what if ...?" moments.

Thanks for the feedback.
 
Upvote 0
Well your Hey what if moment has saved me hours of work today which means I will get to the pub later so thank you very much indeed :-)

Thats quite a few times recently your code has helped me so thank you so much

Tony
 
Upvote 0

Forum statistics

Threads
1,223,721
Messages
6,174,097
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top