+ Reply to Thread
Results 1 to 4 of 4

create a button event

  1. #1
    Registered User
    Join Date
    06-24-2005
    Posts
    45

    Thumbs down create a button event

    I have a spreadsheet having a command button. Once I click on this button , This need to create a separate workbook and need to insert ‘following code in the sheet1 under Worksheet_Change event. Would it possible ?

    Please Login or Register  to view this content.
    Any help is appreciated…

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The simplest way is to copy the sheet to a new workbook. The code will copy with it.
    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
    06-24-2005
    Posts
    45
    Quote Originally Posted by royUK
    The simplest way is to copy the sheet to a new workbook. The code will copy with it.
    Thanks for quick reply, The main requirement is to create around 15 similar sheets for each employee in everyweek. I thought this can be automated by doing this.

    It would be great if you could throw some light on this.

    Jophy

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jophy,

    Copy the code below into a Standard VBA module. This will automatically insert the Worksheet_Change event procedure, and your macro into Sheet1 of each Open Workbook. You will need to add a Reference to the Microsoft Visual Basic for Applications Extensibility library before this macro will run.

    1. In the Visual Basic Editor go to Tools > References...
    2. Scroll through the dialog box until you find Microsoft Visual Basic for Applications Extensibility
    3. Click the Check Box to the left of the entry and click OK
    4. Save your project
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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