Selected Answer
Hi Crash,
I hope this code works well for you
Dim s As Comment
Dim i, c As Integer
Dim act, ant As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
/// This is in order to give a inicial value to i
i = Application.WorksheetFunction.Max(1, i)
Set s = Cells(i, 3).Comment
/// In this conditional I get the value from the cell previously selected
If s Is Nothing Then
act = ""
Else
act = s.Text
End If
/// If the note was change, write the timestamp
If act <> ant Then Cells(i, 4) = Now
/// Only when is selected a cell in row 3, where I have the cells with notes to change
/// I get the text from note, if there is, and the row of the cell to use in the beginig of
/// the procedure next time is run
If Target.Column = 3 Then
Set s = Target.Comment
If s Is Nothing Then
ant = ""
Else
ant = s.Text
End If
i = Target.Row
End If
End Sub
I also attached a sample of the file. Feel free to add, edit or delete notes in column 3 and timestamp will be in column D. Any comments or doubts, let me know
Regards
Basilio