Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Posts: 84
Default Comment with date stamp

Hello all,

I copied these macros from the "Contextures" site but I would like some help. I've already run the this macro:

Sub CommentNote()
Application.UserName = "Note"
End Sub


...but I would like to also have a automatic time stamp in the comment as well. I can run the following macro but the comment only shows the time, not the above "Note" and you have to run the macro for the time to show.


To insert a comment with the current date and time, or append the current date and time to an existing comment, use the following macro:

Sub CommentDateTimeAdd()
'adds comment with date and time,
' positions cursor at end of comment text
'www.contextures.com\xlcomments03.html

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



I'm wanting to have comments look like this:

12-8-09 10:30 AM (whatever the date & time was upon "Insert Comment")
Note:



Thanks in advance,

K
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Separating date from a Date & Time stamp JT Excel Discussion (Misc queries) 9 June 10th 08 05:55 PM
Date Stamp Leon Excel Worksheet Functions 2 September 12th 07 02:07 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
Date stamp spreadsheet in excel to remind me of completion date Big fella Excel Worksheet Functions 1 October 18th 05 04:10 PM
Date Stamp newbie6182000 Excel Discussion (Misc queries) 2 July 9th 05 11:27 PM


All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"