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