+ Reply to Thread
Results 1 to 4 of 4

Change location of commandbuttons on multi page in userform using vba

  1. #1
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Change location of commandbuttons on multi page in userform using vba

    Hi all

    Can this be done?

    I have a userform with a multipage control with 12 pages. Page (0) is called Frequently Used. Pages 1 to 12 all have a number of command buttons. The code for each command button has a code which identifies which page it is on. If any command button is used at least once, I want to move that command button to the Frequently Used page (Pages(0)).

    Is this possible programatically?

    Cheers


  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Change location of commandbuttons on multi page in userform using vba

    You can copy all the controls from one multipage to another but I've never seen anything for copying/moving a single control.

    What do all the command buttons do?

    Perhaps you could have something at run-time that adds them to specific pages based on some sort of criteria.

    If you did that you would need a class module to handle the click events of the command buttons.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Re: Change location of commandbuttons on multi page in userform using vba

    Sorry about the delay in responding, Norie.

    Below is the code for two selected buttons:

    Please Login or Register  to view this content.
    and ...

    Please Login or Register  to view this content.
    There are about 400 buttons in different tabs of the Multipage1 control. I think your suggestion is good, but how do I even start coding that!!!?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Change location of commandbuttons on multi page in userform using vba

    Why do you have all these command buttons?

    They appear to do basically the same thing with a few minor changes.

    What's the purpose of the form?

    Why not use a control that can handle multiple items, for example a listbox or combobox?00

+ 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