Insert Comment Macro

J

Jim Reed

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!
 
B

bc

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
 
G

Gary''s Student

Sub commentable()
With ActiveCell
.ClearComments
.AddComment
.comment.Visible = False
.comment.Text Text:="late assignment"
.Select
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top