+ Reply to Thread
Results 1 to 3 of 3

Automatically define Name of button and add code

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Automatically define Name of button and add code

    Hi Everyone,

    I am trying to create a document with a lot of different sheets. To keep it organized I want all sheets to be hidden but the one that is open. To navigate through all sheets I have a starting sheet. On this sheets buttons are placed that direct you to the sheet you want. So far so good!

    However, since I have to create a lot of sheets I would like to have a automatic sheet and button creation button. This button calls up a Userfrom in which the new button/sheet name and caption is defined. However I am stuck at this point. I don't know how to change the name of the button that is created with the text from the userform. Next also the coding should be added that would make it possible to navigate to this sheet.

    Can anybody help me, please? If added a testdocument to clarify what I mean.

    Thanks!

    TestProject2.xlsm

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Automatically define Name of button and add code

    Why not just create a userform with all the sheets in a list box where you can select the one you want? There's no need to keep adding buttons then and it does the same thing

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Automatically define Name of button and add code

    Hi Kyle,

    Thanks for your advice. I looked into the list box and it worked. Even managed to find a code to sort the sheets alphabetically.

    If interested I added the result.

    I only do not understand why the selectbutton on the start sheet needs to be called "button 5" in the code and not "Select"

    TestProject3.xlsm

+ 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