Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a multi sheet workbook with an on event (sheet activate) macro.
I want to go to a fixed sheet perform a seperate macro and then to return to the current sheet. Each time a sheet is activated. Do I need to get the current address in some way and then enter this or is there a "return here" function? Many Thanks Paul Moles |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
No automatic return, so you have to save the exited sheet somewhere. This might get you started Private PrevSheet As String Private Sub Workbook_SheetActivate(ByVal Sh As Object) MsgBox PrevSheet End Sub Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) PrevSheet = Sh.Name 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 RP (remove nothere from the email address if mailing direct) "Paul Moles" wrote in message ... I have a multi sheet workbook with an on event (sheet activate) macro. I want to go to a fixed sheet perform a seperate macro and then to return to the current sheet. Each time a sheet is activated. Do I need to get the current address in some way and then enter this or is there a "return here" function? Many Thanks Paul Moles |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Activate Sheet After Move Macro | Excel Discussion (Misc queries) | |||
Return number of current sheet | Excel Worksheet Functions | |||
Activate Macro on Activating a sheet | Excel Programming | |||
Event in current sheet | Excel Programming | |||
Activate sheet event | Excel Programming |