Excel hyperlink to scroll to specific section of active sheet.

noslenwerd

Board Regular
Joined
Nov 12, 2019
Messages
51
I know you can link directly to a cell pretty easily with an image in excel, but what if I want it to have the specified cell show AT THE TOP of the sheet?

What happens now, is the hyperlink does take me to a specific cell, but it scrolls to the bottom of the sheet. I would like to have the selected cell be at the top of the sheet.

Any tips?
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
983
Office Version
2007
Platform
Windows
You could have the image click run a macro that first selects a cell well below the one you want, then selects the wanted cell.
 

RicoS

New Member
Joined
May 1, 2019
Messages
18
In vba, you could use:

VBA Code:
Application.GoTo Range("A123"), true
replacing A123 with your range (probably best to declare your range in a variable
 

solidENM

Board Regular
Joined
Feb 23, 2017
Messages
87
insert formula into that row to show whatever cell you want to reference.
eg: click a1, then enter formula: =a100
 

RicoS

New Member
Joined
May 1, 2019
Messages
18
Interestingly, if you put a hyperlink to another cell into a worksheet cell (not using the hyperlink formula, which could be called from the selectionChange event instead) then you can use the followhyperlink event in the worksheet code:

VBA Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target as Hyperlink)
    Application.Goto Range(Target.Name), True
End Sub
Obviously you would have to moderate the code to ensure that it was a worksheet range that you were linking to, or add in error handling to cope.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,694
Messages
5,488,314
Members
407,634
Latest member
ps01

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top