Some comments/suggestions.
@JackDanIce
Whilst your code does put the date in col B when a hyperlink** in col A is clicked, it will also insert, incorrectly, dates in other circumstances. Examples:
- Select any single cell (not containing a hyperlink) in column B (here your count is 0+1+2=3 so date is entered in column C)
- Select any 2 cells (not containing hyperlinks) in column A (here your count is 0+2+1=3 so dates will be entered in
two cells in column B though no hyperlink is clicked)
@bchadwick
** There are two types of hyperlinks that can be used in excel. One is set up by a formula and one through Insert -> Link
Both the codes suggested above only work with the Insert -> Link type of hyperlink.
The same applies to my code below. I am offering the alternative code since generally in a worksheet a lot of 'selecting' may take place. If it turns out that much of the 'selecting' is not related to clicking hyperlinks then any Worksheet_SelectionChange code may be triggered much of the time when not necessary. Most likely that will not be any issue for you, but the following code will
only get triggered when a hyperlink is clicked. Anyway, it could be an option for you & it is a very simple code.
This code would also go in the worksheet's module - same place as described by MAIT for his code. However, don't have my code and a Worksheet_Change code in the workbook at the same time trying to do the same job - just one at a time.
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Column = 1 Then Target.Range.Offset(, 1).Value = Date
End Sub
Further, if you don't have hyperlinks anywhere in the sheet except column A, then the code could be even simpler.
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Target.Range.Offset(, 1).Value = Date
End Sub