Code in Thisworkbook module
Standard code module![]()
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) If g_objLastSheet Is Nothing Then Exit Sub Set g_objLastSheet = Sh End Sub
No idea how you are using it though![]()
Sub MoveBack() Debug.Print "Before", ActiveSheet.Name, g_objLastSheet.Name g_objLastSheet.Activate Debug.Print "After", ActiveSheet.Name, g_objLastSheet.Name End Sub
Bookmarks