LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activate Sheet After Move Macro jlclyde Excel Discussion (Misc queries) 2 December 17th 08 07:27 PM
Return number of current sheet Brandon Excel Worksheet Functions 3 April 26th 05 05:55 AM
Activate Macro on Activating a sheet Bob Phillips[_6_] Excel Programming 0 June 4th 04 05:19 PM
Event in current sheet Peter Wallin Excel Programming 1 February 26th 04 03:00 PM
Activate sheet event Mike Fogleman Excel Programming 5 January 18th 04 11:02 PM


All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"