I have a workbook with 8 sheets. On each department sheet, I have hyperlinks which direct the user to the raw data from which the report was created.
I wanted to have a button on my raw data sheet which would be a "Go Back" button and take the user back to last sheet they were on (when they clicked the hyperlink).
I have the code below that does this to some extent, but I cannot get it to work for my situation here. This code I believe references the last worksheet clicked on, and ignores the hyperlink all together.
Is it possible to tweak my code below to take into consideration hyperlinks?
I have the below macro which is executed by pressing a form button:
Global WhtSheet As String, LastSheet As String
Sub GoBack()
Sheets(LastSheet).Select
End Sub
Additionally, I have the code below on each sheet in my workbook.
Private Sub Worksheet_Activate()
LastSheet = WhtSheet
WhtSheet = ActiveSheet.Name
End Sub
Thanks for any assistance or feedback with this request.
I wanted to have a button on my raw data sheet which would be a "Go Back" button and take the user back to last sheet they were on (when they clicked the hyperlink).
I have the code below that does this to some extent, but I cannot get it to work for my situation here. This code I believe references the last worksheet clicked on, and ignores the hyperlink all together.
Is it possible to tweak my code below to take into consideration hyperlinks?
I have the below macro which is executed by pressing a form button:
Global WhtSheet As String, LastSheet As String
Sub GoBack()
Sheets(LastSheet).Select
End Sub
Additionally, I have the code below on each sheet in my workbook.
Private Sub Worksheet_Activate()
LastSheet = WhtSheet
WhtSheet = ActiveSheet.Name
End Sub
Thanks for any assistance or feedback with this request.