Excel vba Hyperlink help again

wahmed

Board Regular
Joined
Jun 28, 2010
Messages
66
Dear Fellows.

Could you please help me regarding Excel vba hyperlink Cell reference ?

I have many sheets in a workbook and each sheet is linked to other but my problem is that when ever I follow hyperlink for going to next sheet and when come back again with back hyperlink then set focus cell is A1 in sheet, is there anyway that when every I go to next sheet and then come back to main sheet with back help then I get my cell focus same cell inwhich I was before instead of going top of sheet as A1 ...

Could you please help me ?

regards

Wahmed
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello Wahmed,

One option would be to create a Named Range that holds a reference to the last Hyperlinked range clicked.

To do this:
1. Make a Range named: ReturnLinkAddress

The initial address can be any cell, since this will change each time a Cell with a Hyperlink is selected.

2. Next, edit your "Return Back" hyperlinks to go to: ReturnLinkAddress
(In the Edit Hyperlinks dialog box click on ReturnLinkAddress in the Defined Names section.)

3. Lastly, add this VBA Event Code to the Sheet Code of any Sheets that have Hyperlinks that you want to return to.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Hyperlinks.Count = 1 Then
        ActiveWorkbook.Names("ReturnLinkAddress").RefersTo = _
            Target
    End If
End Sub

That's a lot of steps, so just let me know if you get stuck.

Good luck! :)
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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