LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Previous Worksheet

I copied this a few days ago and it works fine, sorry that I cannot offer
thanks to the author. I failed to write down names.

Please I need everyones help. Thanks

Questions;
1. This code works 90% of the time, but then it locks, I can manually
restart it by using the sheet tags and going to any other sheet, then click
on the command button to revert back to the previous sheet and then that
button starts working again. WHY ?? Whats the fix ???????

2. How can this code be change to stack up to 5 previous worksheets in
memory, rather than flipping back and forth between the two same sheets ??

Previous Worksheet code;
----Placed in Thisworkbook----

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Not rCurrent Is Nothing Then Set rPrevious = rCurrent
Set rCurrent = ActiveCell
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)
If Not rCurrent Is Nothing Then Set rPrevious = rCurrent
Set rCurrent = Target
End Sub

----Placed in Module1---

Public rPrevious As Range
Public rCurrent As Range

Public Sub GoToPrevious()
If Not rPrevious Is Nothing Then Application.GoTo rPrevious
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
Go back to previous worksheet BarryL New Users to Excel 2 May 5th 05 01:38 AM
Return to previous worksheet after code pastes in another worksheet? Ron[_28_] Excel Programming 4 September 4th 04 07:52 PM
Selecting previous worksheet Carolyne[_2_] Excel Programming 2 May 20th 04 12:05 AM
Selecting previous worksheet Carolyne[_2_] Excel Programming 5 May 19th 04 01:49 PM
reference to previous worksheet Daniel Lidström Excel Programming 2 December 16th 03 07:34 PM


All times are GMT +1. The time now is 01:54 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"