Hi All,
Looking to create a macro which will automatically reference a specific cell (different worksheet), instead of manually changing the cell reference and linking one by one.
For example, user will click on "TB" (1st image), this will take them to the Fines cell in TB worksheet (2nd image).
Have attempted to write a simple macro, however is not working and looking for some advice.
Also looking to see how to go about specifying fines to be linked to fines with an AND function?
Sub Hyperlink()
For Each reference In Range("B3:B7")
If reference = "TB" Then
Worksheets("TB").Activate
Cells(2, "A").Activate.Hyperlinks.Add Anchor:=ActiveCell, Address:="", SubAddress:="'Queries' !B3", TextToDisplay:="TB"
Exit For
End If
Next
End Sub
Looking to create a macro which will automatically reference a specific cell (different worksheet), instead of manually changing the cell reference and linking one by one.
For example, user will click on "TB" (1st image), this will take them to the Fines cell in TB worksheet (2nd image).
Have attempted to write a simple macro, however is not working and looking for some advice.
Also looking to see how to go about specifying fines to be linked to fines with an AND function?
Sub Hyperlink()
For Each reference In Range("B3:B7")
If reference = "TB" Then
Worksheets("TB").Activate
Cells(2, "A").Activate.Hyperlinks.Add Anchor:=ActiveCell, Address:="", SubAddress:="'Queries' !B3", TextToDisplay:="TB"
Exit For
End If
Next
End Sub