+ Reply to Thread
Results 1 to 4 of 4

Common Click event for all command buttons

  1. #1
    Registered User
    Join Date
    03-03-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Common Click event for all command buttons

    Hi,
    I want to know how to put the same click event for various command button.
    e.g.

    Please Login or Register  to view this content.
    Similarly i am having 30 command buttons for which i need to set the same msgbox.
    My question here is, how to set the click event for all the command buttons, without going to the individual button click event?.
    Is there a way to give generic event for all the command buttons
    Last edited by Leith Ross; 03-15-2011 at 01:48 AM. Reason: Edited Code Tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Common Click event for all command buttons

    You need a Class module to achieve this.
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-03-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Common Click event for all command buttons

    Thanks for the help, it working fine now
    One question we can set the common event for label as well by using class event?
    and for any of the object?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Common Click event for all command buttons

    Why would you want an event for a label?

+ 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