Hi,
I have a workbook with 13 Sheets, which is pretty much a daily report.
Sheet one is called Navigation calendar. This sheet has all the hyperlinks to navigate to each month which are the 12 sheets, Jan to Dec and are hidden. Now if I get one sheet right then the rest should work.
In the "navigational calendar" I have dates that would point out to a day which would unhide that particular sheet.
Ex: Jan 1 is hyperlinked, I click it and it unhides Sheet 2 - which is named "January". Now I have figured out the code on how to unhide while clicking the hyperlink from the parent sheet (Navigational Calendar).
The problem here is I want to create a macro, since I have buttons in the remaining 12 sheets. When I click the button "Back" or "go to navigational calendar" I want the current sheet to hide and go to the target page that it is hyperlinked to.
All the 12 sheets will be hidden, I was able to figure out the first part. Going to the Parent sheet and unhiding it by clicking the hyperlink.
Code to Unhide when clicking a hyperlink
for the second part I Need to run a macro to hide by clicking a button that says "BACK", which is where I am blank.
Thank you. It would be great if I could get this to work on my reports.
I have a workbook with 13 Sheets, which is pretty much a daily report.
Sheet one is called Navigation calendar. This sheet has all the hyperlinks to navigate to each month which are the 12 sheets, Jan to Dec and are hidden. Now if I get one sheet right then the rest should work.
In the "navigational calendar" I have dates that would point out to a day which would unhide that particular sheet.
Ex: Jan 1 is hyperlinked, I click it and it unhides Sheet 2 - which is named "January". Now I have figured out the code on how to unhide while clicking the hyperlink from the parent sheet (Navigational Calendar).
The problem here is I want to create a macro, since I have buttons in the remaining 12 sheets. When I click the button "Back" or "go to navigational calendar" I want the current sheet to hide and go to the target page that it is hyperlinked to.
All the 12 sheets will be hidden, I was able to figure out the first part. Going to the Parent sheet and unhiding it by clicking the hyperlink.
Code to Unhide when clicking a hyperlink
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Application.Goto ActiveCell, True
LinkTo = Target.SubAddress
WhereBang = InStr(1, LinkTo, "!")
If WhereBang > 0 Then
MySheet = Left(LinkTo, WhereBang - 1)
Worksheets(MySheet).Visible = True
Worksheets(MySheet).Select
MyAddr = Mid(LinkTo, WhereBang + 1)
Worksheets(MySheet).Range(MyAddr).Select
Application.Goto ActiveCell, True
End If
End Sub
for the second part I Need to run a macro to hide by clicking a button that says "BACK", which is where I am blank.
Thank you. It would be great if I could get this to work on my reports.