Do the following:
In the cell where the value is, right-click and select "Hyperlink."
In the hyperlinks window, select the "Place In This Document" button and enter the address of the cell itself where the value is. Click OK. This hyperlink will not do anything as it takes you to the cell where it was clicked.
Open the Excel VBA code window ( ALT + F11 ) and add the following code to the worksheet:
Private Sub Worksheet_FollowHyperlink(ByVal oTarget As Hyperlink)
Dim sURL As String
sURL = "http://teste/teste/view.php?id=" & ActiveCell.Value
ActiveWorkbook.FollowHyperlink sURL
End Sub
Note that this code captures the event of the specific worksheet (the
worksheet , that is, the tab) and not the whole file. If you have more than one
(Plan1, Plan2, Plan3, etc.) and you want to do the same on it, you need to double
this code.