locked
Name of button RRS feed

  • Question

  • Hi,
    I want to get the names of all button of this file. Can you please help?


    Many Thanks & Best Regards, Hua Min

    Tuesday, November 13, 2018 7:03 AM

All replies

  • Something like this:

    Sub ListButtons()
        Dim btn as Button
        For Each btn in ActiveSheet.Buttons
            Debug.print "Button " & btn.Name & " with caption " _
                & btn.Caption & " Located at " & _
                btn.topleftcell.address
        Next
    End Sub



    Regards, Jan Karel Pieterse|Excel MVP|http://www.jkp-ads.com

    Tuesday, November 13, 2018 9:39 AM
  • How about to remove whatever buttons existing with one Excel file with a file name?

    Many Thanks & Best Regards, Hua Min

    Tuesday, November 13, 2018 9:42 AM
  • I choose property to the button but why can't I see the name of the button?

    To this file, why can't I run the macro inside it?



    Many Thanks & Best Regards, Hua Min


    • Edited by Jackson_1990 Wednesday, November 14, 2018 2:16 AM
    Wednesday, November 14, 2018 1:41 AM
  • Hi HuaMin,

    We can't run a macro in Excel online. Try to use the desktop Excel to run it.

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, November 14, 2018 6:24 AM
  • Hi,

    How?


    Many Thanks & Best Regards, Hua Min

    Wednesday, November 14, 2018 6:33 AM
  • Hi HuaMin,

    You can follow the steps in the following link:

    Create a Macro

    Hopefully it helps you.

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, November 14, 2018 8:13 AM
  • if you wish to achieve above in Excel Online then it's not possible using Macro, but possible for standalone excel installation. 

    Creating a Macro is simple and straightforward if you know a bit of programming.

    Regards,

    Khalil Kothia,

    MCP, PMP, Corporate Trainer

    Wednesday, November 14, 2018 8:22 AM