View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default timestamp comments

Hi Ben

You can run this macro if you want to add a comment with date/time stamp or change the date/time in the comment.

Sub Test()
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=Format(Now, "dd-mmm-yy hh-mm-ss")
Else
If IsNumeric(Right(ActiveCell.Comment.Text, 2)) Then
ActiveCell.Comment.Text Text:=Left(ActiveCell.Comment.Text, Len(ActiveCell.Comment.Text) - 18) _
& Format(Now, "dd-mmm-yy h-mm-ss")
Else
ActiveCell.Comment.Text Text:=ActiveCell.Comment.Text & Chr(10) & Format(Now, "dd-mmm-yy hh-mm-ss")
End If
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"BenMetz" wrote in message ...
helped me a few ways. show me how to add a comment, and how to remove the
username. however, i have no programming knowledge and wouldn't be able to
complete the script :) so buddy, wanna just write it all for me? :/ (sorry
for being lazy, don't have the time to start learning syntax.)

"Ron de Bruin" wrote:

Hi Ben

Only possible with code as far as I know

See this page
http://www.contextures.com/xlcomments01.html



--
Regards Ron de Bruin
http://www.rondebruin.nl


"BenMetz" wrote in message ...
I am looking for a small piece of code that will format a comment feild in
microsoft excel to start with the current date and time.

this is details of what exactly the code needs to do:

1.Insert Comment
2.Code inserts date and timestamp into the newly opened comment field.
3.If you select "Edit Comment", it will create a two 's after the last typed
word (paragraph). And then timestamp there.

could anyone lend a hand? (well, alittle more than a hand)