Reverse Hyperlink

cmeier7

Board Regular
Joined
Jul 23, 2009
Messages
64
Is there any way to create a reverse hyperlink in Excel? It would be something that would mimic the back button in an internet browser, only my hyperlinks are not URL oriented- they navigate through a workbook. So for example, if a hyperlink takes me to one worksheet within a workbook, is there a way to create a hyperlink that will take me back to the previous sheet?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Here is example of the functionality you are asking about.

I have three worksheets: Sheet1, Sheet2, and Sheet3. On each worksheet there are hyperlinks to other worksheets, plus a hyperlink that says "Back". For example, Sheet1 looks like this:
Excel Workbook
AB
1BackSheet2
2Sheet3
Sheet1
Excel 2003

Here is what I did to get the Back hyperlink working as expected:

(1) Create a new module to and add the following code:

Code:
Global PrevSheet As Worksheet

(2) In the "ThisWorkbook" module, add the following code:

Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
    If Target.Name<> "Back" Then
        Set PrevSheet = Sh
    ElseIf Not PrevSheet Is Nothing Then
        PrevSheet.Activate
        PrevSheet.Range("A1").Select
    Else
        Exit Sub
    End If
End Sub

This seems to do the trick for my basic setup. Undoubtedly you will need to configure this for your particular needs.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top