blade402
11-23-2013, 03:20 PM
I want to be able to return to the worksheet I was looking at when I activate coding that takes me away from the currently viewed worksheet. I tried this, but it is now working. Anyone know how to fix this?
Code:
'in ThisWorkbook
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Set LstSht = Sh End Sub
'in Standard Module
Public LstSht As Worksheet
Sub GoToLast() LstSht.Activate
End Sub
Code:
'in ThisWorkbook
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Set LstSht = Sh End Sub
'in Standard Module
Public LstSht As Worksheet
Sub GoToLast() LstSht.Activate
End Sub