Thread: Add Hyperlink
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Add Hyperlink

'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.


"Looping through" wrote in
message ...
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