VBA hyperlink

Russk68

Well-known Member
Joined
May 1, 2006
Messages
589
Office Version
  1. 365
Platform
  1. MacOS
Hi All!
I would like to click on a cell in one sheet and hyperlink to a cell in another sheet based on the cell value.
Example:
Sheet 1 column A, is a range of dates. Sheet 2 column A, is also a range of unique dates in chronological order.
I would like to click on a date in Sheet 1 column A and hyperlink me to the same date in Sheet 2 column A.

Thank you!
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Click on any cell in column A of Sheet(1) and script will select same value in column A of Sheet(2)

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Modified  1/9/2019  12:53:03 AM  EST
If Target.Column <> 1 Or Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Dim SearchRange As Range
Dim lastrow As Long
lastrow = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
Set SearchRange = Sheets(2).Range("A1:A" & lastrow).Find(Target.Value)
If SearchRange Is Nothing Then MsgBox Target.Value & "  Not Found": Exit Sub
Application.Goto SearchRange

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

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
Back
Top