LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Comment with date stamp

Sub CommentDateTimeAdd()
Dim strDate As String
Dim cmt As Comment

strDate = "dd-mmm-yy h:mm:ss AM/PM"
Set cmt = ActiveCell.Comment

Set cmt = ActiveCell.AddComment
cmt.Text Text:=Format(Now, strDate) & Chr(10) _
& "NOTE:"

End Sub

You can assign the macro to InsertComment if you wish.

Steps for Excel 2003 and earlier.

Stick the macro in a general module in your workbook.

Then in Excel ToolsCustomize.

InsertComment..............assign the macro to Comment command.

I have not worked with 2007 enough to give help on assigning a macro to an
existing command.

Ron de Bruin is the master of that.

http://www.rondebruin.nl/tips.htm

Excel 2007 Ribbon and QAT pages


Gord

On Tue, 22 Dec 2009 03:23:01 +0000, Keyrookie
wrote:


Thank you, Gord. After following Debra's instructions I realize I'm
wanting some further edits. Is there a way to have this without having
to run a macro? Insert into the "ThisWorkbook" and have the time format
not military?

Any ideas...

Gord Dibben;911705 Wrote:
See Debra Dalgleish's site for full Insert Comment with date/time code

http://www.contextures.on.ca/xlcomments03.html#DateTime

Here is revised version which pre-supposes no existing Comment in cell
and
adds the "NOTE:" all in bold font.

Sub CommentDateTimeAdd()
Dim strDate As String
Dim cmt As Comment

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

Set cmt = ActiveCell.AddComment
cmt.Text Text:=Format(Now, strDate) & Chr(10) _
& "NOTE:"

End Sub


Gord Dibben MS Excel MVP


On Mon, 21 Dec 2009 18:09:31 +0000, Keyrookie
wrote:
-

Is there a way to have a comment, when "Insert Comment" is selected,

to
look like this?

12-19-09 (current date), 12:02 p.m. (current time)
NOTE:

In other words, have comments display current date & time when
selected?

Thanks,
K-


 
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
Comment with date stamp Keyrookie Excel Worksheet Functions 0 December 9th 09 05:29 PM
Separating date from a Date & Time stamp JT Excel Discussion (Misc queries) 9 June 10th 08 05:55 PM
Date Stamp Need Harvey Gersin Excel Worksheet Functions 3 July 2nd 06 07:13 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


All times are GMT +1. The time now is 12:41 AM.

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

About Us

"It's about Microsoft Excel"