Add Hyperlink

  • Thread starter Looping through
  • Start date
L

Looping through

I have a working book that contains a lot of job numbers on one sheet and
specific notes related to that job number on another sheet. I want to be able
to automatically add a hyperlink when you click on the job number to jump to
the specific notes on the secondary sheet.

The main job numers are listed in column B of workbork ("MAIN") and notes
are sorted by job number in column A of workbook ("Notes").

I hope there is something possible for this, when the users add notes to the
job they have to manually add a hyperlink. but if a note from another job is
added above the hyperlink cell references changes and thus creates issues in
remapping the hyperlink.

Let me know if you need more information.
Thanks
Peter
 
T

Tim Williams

'This in the sheet code module
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim v, f
v = Target.Range.Value

Set f = ThisWorkbook.Sheets("Notes").Range("A:A").Find(v, , xlValues,
xlWhole)
If Not f Is Nothing Then
f.Parent.Activate
f.Select
End If

End Sub

As long as there's a valid hyperlink on the cell with the job# it should
take you to the matching note.
If there's no matching note it will follow the hyperlink.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top