Please help - run macro when switching sheets

Solved/Closed
D - Jun 7, 2010 at 10:31 AM
 D - Jun 7, 2010 at 03:33 PM
Hello,

If someone could tell me how to run a macro upon switching worksheets, that would be extremely helpful. If this is not possible, perhaps running a macro upon clicking a new cell? I just don't want the workbook to move too slowly with every click running the macro.

Thank you!


1 reply

rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
770
Jun 7, 2010 at 10:51 AM
You have to use either of the two routines in the sheet

This you would be using if you want macro to be fired as sheet is deactivated
Private Sub Worksheet_Deactivate()

End Sub

This you would be using if you want macro to be fired as sheet is activated
Private Sub Worksheet_Activate()

End Sub
6
Thank you!!! Very helpful!
0