Run Macro on Worksheet Activate

  • Thread starter Matthew John Antoszkiw
  • Start date
M

Matthew John Antoszkiw

Hello,
I'm trying to run some code when a worksheet is activiated (when the user
views it via the tabs). I tried using this code and adding to the worksheet
I wanted via the VBA editor:

Private Sub Worksheet_Activate()
'do stuff
msgbox("TEST")
End Sub

Nothing happens when the worksheet is activated. What am I doing wrong?
many thanks.
 
C

Colo

Hello Matthew,

That code works on me, please try type the code below in the immediat
window and press Enter key.

Application.EnableEvents may has been set as False.


Code
 
Top