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

Here's a step-by-step:

1. Copy code below:

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

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

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

End Sub

2. Open a new workbook
3. Click on "View Code" from any sheet
4. On the Visual Basic window click "InsertModule"
5. Paste code into Module1
6. Return to sheet
7. Click "ToolsCustomize" and a window pops up
8. Select "Insert" menu at top of page (not in the open window)
9. Select "Comment" from drop-down menu from "Insert"
10 Right click and select "Assign Macro" from drop-down menu
11 Click on "CommentDateTimeAdd" from Macro window"OK", window closes
12 Click "Close" on the still open "Customize" window

Am I missing anythng?

K
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Comment with date stamp, again

Your code will throw an error if the activecell already has a comment. You
might want to:

1. test for a comment and exit
or
2 test for a comment and delete it before putting the new one in.
--
Gary''s Student - gsnu200909


"Keyrookie" wrote:


Here's a step-by-step:

1. Copy code below:

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

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

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

End Sub

2. Open a new workbook
3. Click on "View Code" from any sheet
4. On the Visual Basic window click "InsertModule"
5. Paste code into Module1
6. Return to sheet
7. Click "ToolsCustomize" and a window pops up
8. Select "Insert" menu at top of page (not in the open window)
9. Select "Comment" from drop-down menu from "Insert"
10 Right click and select "Assign Macro" from drop-down menu
11 Click on "CommentDateTimeAdd" from Macro window"OK", window closes
12 Click "Close" on the still open "Customize" window

Am I missing anythng?

K




--
Keyrookie
.

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
Comment with date stamp Keyrookie Excel Worksheet Functions 10 December 26th 09 07:38 PM
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
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 04:20 PM.

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"