+ Reply to Thread
Results 1 to 4 of 4

Macro to delete macro button issues

  1. #1
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Macro to delete macro button issues

    Hi Guys

    I have a situation where I have a code which copies a sheet and renames it a cell value.
    But these sheets which have been copied over also have the macro button on which I want deleted.

    So I recorded a macro in 2003 excel then had issues when using it in the 1997 excel in work.

    The problem I got is: In the newer version, the macro button is called "Button1" but in the older version its called "Button 14"

    Is there a way which i can delete this button?

    Here is the code below so you can see whats happening:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to delete macro button issues

    Hi, Dibbley247,

    have you tried giving a name to the button other the standard from VBA?

    Or you might try acting upon the Version used to decide what number the button has (I assumed 2007 as 12 whereas 97 would be 8):
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Macro to delete macro button issues

    Thanks guys.
    Just tried the one from Norie and its worked on the older version.

    I never thought about renaming the button!!!!
    thanks for your help guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1