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:
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...???
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:
Private Sub Worksheet_Activate()
MsgBox "yes"
End Sub