Forum Discussion

RiverKing's avatar
RiverKing
Copper Contributor
Dec 09, 2020
Solved

Positioning a row at the top of the window via an internal link

On a worksheet with many rows of text, I help the user navigate via internal links to topic-specific, named cells.  The user just clicks on a topic to display the topic.  This works very nicely excep...
  • JMB17's avatar
    JMB17
    Dec 09, 2020

    RiverKing 

     

    Try this. Right click on your worksheet tab, select view code, and paste this into the code module.

     

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
         Dim cell As Range
         
         On Error Resume Next
       
         Set cell = ActiveSheet.Range(Target.SubAddress)
    
         If Not cell Is Nothing Then
              Application.Goto ActiveCell, Scroll:=True
         End If
         
    End Sub

Resources