Call to run macro when shett activated?
Call to run macro when shett activated?
(OP)
Lets say I have a Workbook with 2 Sheets in it, Sheet 1 and Sheet 2. Is there a way I can make a macro (automatically) run every time the user selects/activates Sheet 2? Also, if the file is opened and Sheet 2 is the active Sheet, I would like the macro to (automatically) run then too.
Thanks,
Ken
Thanks,
Ken





RE: Call to run macro when shett activated?
HTH
RE: Call to run macro when shett activated?
Can you give more detail for the VB-illiterates like me? Where does Worksheet_Activate() go? Is it part of the macro, or does it call the macro? Thanks.
RE: Call to run macro when shett activated?
2. Open the Projects exploere (CTL-R)
3. Select the sheet whose events you're looking for
4. In the DropDown at the top left of the sheet code window Select Worksheet
5. In the DropDown top right select Activate
6. Put your code here:
Private Sub Worksheet_Activate()
' Your code
End Sub
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
RE: Call to run macro when shett activated?
Thanks!
Ken
RE: Call to run macro when shett activated?
RE: Call to run macro when shett activated?
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk
RE: Call to run macro when shett activated?
RE: Call to run macro when shett activated?
RE: Call to run macro when shett activated?
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk