+ Reply to Thread
Results 1 to 3 of 3

Assign code to button created dynamically

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    2

    Assign code to button created dynamically

    Hey,

    I've got the code creating buttons dynamically which I want to assign action to. The action gonna be the same for each created button on userform.
    I would be appreciate for any ideas how to do it.

    Here is example part of my code generating given amount of buttons with caption (+):

    Please Login or Register  to view this content.
    And now for each created CommandButton I'd like to assign same action.
    And if possible I don't want to create many command buttons on userform in hidden mode just want to assign action dynamically during runtime to exact number of generated buttons.
    Last edited by ranigast; 07-24-2014 at 01:50 PM.

  2. #2
    Registered User
    Join Date
    07-24-2014
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    2

    Re: Assign code to button created dynamically

    Anybody ... ?

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Assign code to button created dynamically

    There are many posts on the topic.

    You need to create a class object.
    http://spreadsheetpage.com/index.php...er_dialog_box/
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-22-2014, 04:18 PM
  2. Assign code to Toolbar Created in VB to Hide Sheets and then Rehide
    By Simon Austin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-23-2009, 09:10 AM
  3. automated code for handling events in a dynamically created sheet -- possible?
    By francoiss in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2007, 12:18 AM
  4. Assign click functionality to dynamically created textboxes?
    By Ouka in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2005, 10:15 PM
  5. Replies: 3
    Last Post: 03-03-2005, 05:06 PM

Tags for this Thread

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