Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I create a generic back button for my workbook, so that it goe
to the last view worksheet? Is this even possible -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fraggs,
Put this code in the ThisWorkbook code module Public prevWs As Worksheet Private Sub Workbook_Open() Set prevWs = ActiveSheet End Sub Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) Set prevWs = Sh End Sub and add this code to a standard code m odule and tie your button to it Sub PrevSheet() ThisWorkbook.prevWs.Activate End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Fraggs " wrote in message ... How can I create a generic back button for my workbook, so that it goes to the last view worksheet? Is this even possible? --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Code in a regular module: Public OldSheetName As String Public mySheetName As String Sub ReturnToLastSheet() Worksheets(OldSheetName).Activate End Sub Code in the Thisworkbook object: Private Sub Workbook_Open() MySheetName = "Sheet1" 'Change as appropriate End Sub Private Sub Workbook_SheetActivate(ByVal Sh As Object) OldSheetName = mySheetName mySheetName = Sh.Name End Sub Then assign the ReturnToLastSheet macro to a button. HTH Otto "Fraggs " wrote in message ... How can I create a generic back button for my workbook, so that it goes to the last view worksheet? Is this even possible? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for forward and back button | Excel Discussion (Misc queries) | |||
How can I call IE browser (Back button) through Excel macro? | Excel Discussion (Misc queries) | |||
How can I call IE browser (Back button) through Excel macro? | Excel Discussion (Misc queries) | |||
Reverse a Macro - works like back button | Excel Discussion (Misc queries) | |||
Back Button Macro | Excel Programming |