Put this in the ThisWorkbook module. Call the GoBack macro to go to previous sheet.
[pre]
Code:
'Define a local variable
Dim lastSheet As Worksheet
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
'Stored info for later use
Set lastSheet = Sh
End Sub
Sub GoBack()
'This is the macro to take us back to previous sheet
lastSheet.Activate
End Sub
Glad you were able to get it fixed. As an error check, we can change the last macro to this, if you want.
[pre]
Code:
Sub GoBack()
'This is the macro to take us back to previous sheet
If lastSheet Is Nothing Then Exit Sub 'Might want to add a msgBox...your call
lastSheet.Activate
End Sub