Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what is this code suppose to do???
-----Original Message----- 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 . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In an excel file I am using several sheets as menu forms (control forms) to
some 67 metrics. This code provides a means to transet between worsheets as a command button named "Previous" which will return you to the last worksheet you were at. The present code only knows those two conditions 'present and previous'. It seems the code will goto the last cell at some point then the command button is lost until you reprime it by manually going to another worksheet. What I am looking for is code that will stackup several worksheets so one may travel between the sheets and the code would remember say 20 previous sheets. This nice but I hope someone can beef it up a little. " wrote: what is this code suppose to do??? -----Original Message----- 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Go back to previous worksheet | New Users to Excel | |||
Return to previous worksheet after code pastes in another worksheet? | Excel Programming | |||
Selecting previous worksheet | Excel Programming | |||
Selecting previous worksheet | Excel Programming | |||
reference to previous worksheet | Excel Programming |