Results 1 to 2 of 2

Thread: recognizing events in excel...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    TZI Transition Date
    Posts
    272

    recognizing events in excel...

    i think what i am trying to do is trap an event and cause it to trigger more code...but i have no idea how...i am so lost when it comes to whether or not this is possible:
    I open a new workbook.
    I put this code in a module:
    VB Code:
    1. If ActiveSheet.Name = ("1") Then MsgBox "yes"
    I run the code on sheet 1.
    if i run the code ...of course i get yes...
    but how can i make it msg me everytime i select sheet 1 like automatically...???

  2. #2
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: recognizing events in excel...

    have you tried adding your code within an activate sub, within the code of the worksheet you want the code to be ran:

    VB Code:
    1. Private Sub Worksheet_Activate()
    2.  
    3.      MsgBox "yes"
    4.  
    5. End Sub
    if you fail to plan, you plan to fail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width