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 create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,992
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,992
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,970
Messages
5,575,287
Members
412,653
Latest member
JyothiGrace
Top