Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2007

Tip: Looking for answers? Try searching our database.

Insert Comment Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Reed - 24 Nov 2007 19:37 GMT
Hello, Group

I tried to use the macro recorder in Excel 2003 to create a macro to insert
a short comment in the active cell.  I keep getting a "run time error 1004",
which is an application-defined or object-defined error according to the
dialog box that pops up.

Would anyone please show me the VBA code I need to insert the text "late
assignment" into a new comment in the currently active cell, and then exit
the comment box to return to the same cell?

Thank you very much in advance!
bc@brianjwc.vispa.com - 24 Nov 2007 20:15 GMT
Hi Jim,

The only time I had this error was when I tried to resize the comment
box with VBA
Try this :

Sub CommentMacro()
   ActiveCell.AddComment
   ActiveCell.Comment.Visible = False
   ActiveCell.Comment.Text Text:="Late Assignment"
   ActiveCell.Select
End Sub
Jim Reed - 25 Nov 2007 10:18 GMT
Thank you!

> Hi Jim,
>
[quoted text clipped - 8 lines]
>    ActiveCell.Select
> End Sub
Gary''s Student - 24 Nov 2007 20:19 GMT
Sub commentable()
With ActiveCell
   .ClearComments
   .AddComment
   .comment.Visible = False
   .comment.Text Text:="late assignment"
   .Select
End With
End Sub
Signature

Gary''s Student - gsnu2007a

Jim Reed - 25 Nov 2007 10:18 GMT
Thank you!

> Sub commentable()
> With ActiveCell
[quoted text clipped - 5 lines]
> End With
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.