is it possible to time stamp cell comments?

D

Dave F

Thanks, this is interesting. When I use this code and try to run the macro,
I get a pop-up window titled "Add Procedure" with a bunch of options to
select. What's that?

Dave
 
K

Kevin B

Dave, the code worked fine on my PC, it just inserts a comment with the date
and time already posted. This is the code I'm running:

Sub CommentDateTimeAdd()
'adds comment with date and time,
' positions cursor at end of comment text

Dim strDate As String
Dim cmt As Comment

strDate = "dd-mmm-yy hh:mm:ss"
Set cmt = ActiveCell.Comment

If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=Format(Now, strDate) & Chr(10)
Else
cmt.Text Text:=cmt.Text & Chr(10) _
& Format(Now, strDate) & Chr(10)
End If

With cmt.Shape.TextFrame
.Characters.Font.Bold = False
End With

SendKeys "%ie~"
End Sub
 
Top