ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add Hyperlink (https://www.excelbanter.com/excel-programming/413464-add-hyperlink.html)

Looping through

Add Hyperlink
 
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

Tim Williams

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





All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com