Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for Returning to Last Active Worksheet Please
I needed similar capablities but did not want to use a worksheet to hold the
"Previous ActiveSheet" name. The following code works as well: 'Put this at the top of a module window Global PrvusActvSht As String 'Put this in every worksheet in the workbook Private Sub Worksheet_Deactivate() PrvusActvSht = Me.Name End Sub 'Now PrvusActvSht will always = the "Previous ActiveSheet" name. 'Just use: worksheets(PrvusActvSht).select 'to get bact to the "Previous ActiveSheet" Thanks to all for leading toward a solution!! "Carl" wrote: Can anyone tell me the code to use in a macro to return the user to the last active worksheet? The user is being sent to a worksheet containing instructions but needs to be able to return to the last worksheet visited. "ActiveSheet.Previous.Select" did not work. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What is the code for the active worksheet? | Excel Discussion (Misc queries) | |||
Code for Returning to Last Active Worksheet Please | Excel Programming | |||
Returning To Previous Worksheet - Help with sebastienm's code | Excel Discussion (Misc queries) | |||
Altering code to reference the worksheet before the active worksheet | Excel Programming | |||
VBA code that only runs when a worksheet is active | Excel Programming |