hyperlink to defined name in same document

stenmark

New Member
Joined
Mar 15, 2005
Messages
23
Hi

When a hyperlink is done to a defined name in same document it will select the cell at botton of document...I would like the targeted cell (name) to be displayed at the top of the document...Anyone know how to do this?

Thanks in advance.

[/img]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
Can you explain exactly what you mean ... what is the definition of the name? Is cell the one you expected to be selected? When you say "I would like the targeted cell (name) to be displayed at the top of the document." do you mean you want the scrolling to show the selected cell at the top of the window? ( that is not the same as position within a document ... or sheet as we like to say when using Excel )
 
Upvote 0

stenmark

New Member
Joined
Mar 15, 2005
Messages
23
"do you mean you want the scrolling to show the selected cell at the top of the window?"

yes, that is correct =)

thanks
 
Upvote 0

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
Put a selection change event into the worksheet code, like this:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Set isect = Application.Intersect(Target, Range("ThereItIs"))
    If isect Is Nothing Then
        ' do nothing
    Else
        ActiveWindow.ScrollRow = ActiveCell.Row
        ActiveWindow.ScrollColumn = ActiveCell.Column
    End If
End Sub
 
Upvote 0

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
For the sheet where the named range is, right-click the sheet tab and do View Code. Then paste the code I've given into the code window .... altering the name I have "ThereItIs" to whatever name you've defined.
 
Upvote 0

Forum statistics

Threads
1,196,008
Messages
6,012,835
Members
441,732
Latest member
Ayon

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
Top