View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Macro to run when sheet activated

i would just put this code in the trigger sheet code module, then it would only
fire when the trigger sheet is activated or deactivated.

right click the trigger tab and choose view code and paste this there with the
appropriate changes to your sheet names


Private Sub Worksheet_Activate()
Sheets("sheet1").Visible = True
Sheets("sheet2").Visible = True
End Sub

Private Sub Worksheet_Deactivate()
Sheets("sheet1").Visible = False
Sheets("sheet2").Visible = False
End Sub


--


Gary


"JDay01" wrote in message
...
I would like to have certain sheet tabs that are normally hidden in my
workbook to be "unhidden" when I select a specific sheet tab. For example,
let's say I have 3 hidden sheets named A, B, and C. Then, let's say I have
an unhidden sheet called "Trigger", that when I select it, it executes a
macro to unhide sheets A, B, and C. Seems like this should be easy to do
... can someone help?