Auto-Adjusting View for Multiple Hyperlinks

PaulAsaran

New Member
Joined
Feb 11, 2019
Messages
22
I have a single worksheet with lots of data in multiple tables. I'm looking for a way to let other users navigate to the specific data table they need. To resolve this, I created a series of hyperlinks leading to each table. This works fine, but the cell each hyperlink leads to would always be at the bottom of the screen. To resolve this, I found and used the following code:

VBA Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Application.Goto reference:=Range("A36"), scroll:=True

End Sub

The code works, but only for one target destination; it forces the view to switch to the specified cell regardless of which hyperlink I choose. Is there a way to modify this code to target different cells based on which hyperlink is used?
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,903
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
Application.Goto Range(Target.SubAddress), True
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,903
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,812
Messages
5,574,475
Members
412,595
Latest member
slim313
Top