Return to Current Sheet in On (sheet activate) event macro
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
|