How to get all names of Forms Buttons in a Workbook?

jbesclapez

Active Member
Joined
Feb 6, 2010
Messages
275
Hello,

I can not rename a Forms Button and I think it is because the name is taken elsewhere but I have no clue where...

I have tried this macro at the end of the page that should list all buttons names : Macros for Excel Form Control Buttons
But it is not retrieving any button names.

Have you got a trick to list where is teh button used or list all buttons?
Remember, I am not talking about ActiveX buttons.

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello! Maybe
VBA Code:
Sub btn_names()
Dim sh As Worksheet, s As Shape, m$
    With ThisWorkbook
        For Each sh In Worksheets
            m = ""
            m = m & sh.Name & vbCr & vbCr
                For Each s In sh.Shapes
                    m = m & "Element name: " & s.Name & vbCr
                Next s
            MsgBox m
        Next sh
    End With
End Sub
 
Upvote 0
Hello! Maybe
VBA Code:
Sub btn_names()
Dim sh As Worksheet, s As Shape, m$
    With ThisWorkbook
        For Each sh In Worksheets
            m = ""
            m = m & sh.Name & vbCr & vbCr
                For Each s In sh.Shapes
                    m = m & "Element name: " & s.Name & vbCr
                Next s
            MsgBox m
        Next sh
    End With
End Sub
Nice Job!
I added a line to stop it whenever, it is now good.
The strange thing is that I do not see the button name in the worksheet. So why am I not allowed to rename it like this?
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,839
Messages
6,127,196
Members
449,368
Latest member
JayHo

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