LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Return To Last Active Sheet

Perfect! Thanks. I knew why it was going to the Summary sheet but did not
know how to get it to enter the name of the last active sheet in cell A1 of
the Summary sheet without going there. Thanks again.

"FSt1" wrote:

hi
bob is far more experienced than me but to try and answer your delema....
this line is what is sending you to summary.....
Application.Goto Sheets("Summary").Range("A1")
i.e. goto summary...your are sending it to summary.
what i did is eliminate this line and replaced it with this....
Sub FreezePreviousWorksheet()
Previous = ActiveSheet.Name
Sheets("Summary").Range("A1").Value = Previous
End Sub

Sub ReturnToPreviousWorksheet()
Previous = Sheets("Summary").Range("A1")
Sheets(Previous).Select
End Sub

worked in xp. not sure about 07. i haven't worked with that yet.

regards
FSt1

"Carl" wrote:

I am using the following two macros to return the user to the last active
sheet after visiting another sheet (when they leave the first sheet the first
macro runs; when wanting to return, they run the second). The problem is that
it forces them to go momentarily to the sheet "Summary" first. Is there a
better way to do this? I searched all the other strings and could not find
something that would work. Hiding the "Summary" sheet did not work either.
Thanks in adavance,
Sub FreezePreviousWorksheet()
Previous = ActiveSheet.Name
Application.Goto Sheets("Summary").Range("A1")
ActiveCell = Previous
End Sub
Sub ReturnToPreviousWorksheet()
Previous = Sheets("Summary").Range("A1")
Sheets(Previous).Select
End Sub




 
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
How to return to the previous active sheet after hyperlink? Terry Excel Worksheet Functions 5 March 21st 10 02:53 AM
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
Function to return the active sheet name Will Excel Worksheet Functions 2 August 23rd 05 04:33 PM
how can I return the active row and active column? Greg Excel Programming 0 February 3rd 05 07:38 PM


All times are GMT +1. The time now is 10:56 AM.

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"