I am trying to make a macro that will allow me track the use of hyperlinks in an 2010 excel file. Ideally I would like it so that every time a user clicks the hyperlink it displays the user who clicked the link and the actual date the hyperlink was selected. The code below displays the username and date but the date updates every time i open the file.
Problem: Basically if I click on a hyperlink it displays the current date and username. If i save the file and open it the following day the username is correct but the date updates to the current day (not the day the link was originally selected).
Any suggestions would be helpful. Thanks!
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
ThisWorkbook.Activate
Selection.Offset(0, 2).FormulaR1C1 = "=TODAY()"
Selection.Offset(0, 1).FormulaR1C1 = Environ("Username")
' This Code increases the value of the number by "1",
' in the third Cell to the right of the Cell that contains the Hyperlink
' for every Hyperlink, on any/every Row.
End Sub
pic.png
Bookmarks