View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default addin detect worksheet activation

Option Explicit

Private WithEvents App As Application

Private Sub App_SheetActivate(ByVal Sh As Object)
'your code here
End Sub

Private Sub Workbook_Open()
Set App = Application
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
__________________________________
HTH

Bob

"Bill Grigg" wrote in message
...
All,

How can an addin detect that the user has clicked on a different sheet? Do
I
have to somehow put code into the ActiveWorkbook?

Bill