+ Reply to Thread
Results 1 to 3 of 3

Positioning multiple command buttons on a userform using VBA

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

    Positioning multiple command buttons on a userform using VBA

    Hi

    I have been searching the web for days for my answer!

    I have 10 command buttons, cmd1, cmd2, cmd3 etc on a user form. These are positioned one below the other. When I click any of these buttons, say cmd3, then I want cmd3 to be placed at the top and another set of command buttons are placed below this one in a verticle placement. So in example, with cmd3 first then below it are a series of new buttons, cmd3_1, cmd3_2 etc.

    I think an array is the answer but I can't fathom how to do it using vba.

    Can anyone in this forum help?

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Positioning multiple command buttons on a userform using VBA

    This might help you on your way.
    Play something.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Harry.

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

    Re: Positioning multiple command buttons on a userform using VBA

    I knew this forum would come good! Thanks for taking the time Harry. This will get me what I need to do.

    As I have many buttons, and the .Top property will vary by 40 each time (i.e. cmd1.Top=100, cmd2.Top=140, cmd3.Top=180 etc), I assumed that an array would have been required for these values.

    Your code is a much neater way. It's shown me a new coding terminology.

    Cheers

+ 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