I am needing to have VB code place text into the comment box of a series of
cells. Currently the text to be placed is being retrieved from other areas
and being held in a array. At the conclusion of another routine it needs to
be placed on a comparison page for comparing a group of choices. I have
tried using "Activecell.Comment = Comments(X)" where Comments(X) is the
array with the info. However this results in a error "Object does not
support this property or method". Honestly I am at a loss on how to
acomplish what I am wanting.
I have looked in the help documentation but was not able to locate what I
need. I appreciate all help given.
Randy Harmelink - 23 Mar 2006 22:55 GMT
>> Activecell.Comment = Comments(X) <<
Incorrect syntax.
If the cell doesn't already have a comment, you need to add it first:
ActiveCell.AddComment
Then, to set the text of the comment:
ActiveCell.Comment.Text Text:=Comments(X)
Trevor Shuttleworth - 23 Mar 2006 23:09 GMT
To find the Help just type comment, cursor into the middle of the word and
press F1.
To add a comment:
With Worksheets(1).Range("e5").AddComment
.Visible = False
.Text "reviewed on " & Date
End With
To modify a comment:
Worksheets(1).Range("E5").Comment.Text "reviewed again on " & Date
Fot the Active Cell:
With ActiveCell.AddComment
.Visible = False
.Text "reviewed on " & Date
End With
Regards
Trevor
>I am needing to have VB code place text into the comment box of a series of
> cells. Currently the text to be placed is being retrieved from other
[quoted text clipped - 9 lines]
> I have looked in the help documentation but was not able to locate what I
> need. I appreciate all help given.
Gary''s Student - 24 Mar 2006 02:15 GMT
Range("E6").Select
Range("E6").AddComment
Range("E6").comment.Visible = False
Range("E6").comment.Text Text:="Happy Day"
is a syntax that works. In your case "Happy Day" would be replaced by an
element of your string array.

Signature
Gary's Student
> I am needing to have VB code place text into the comment box of a series of
> cells. Currently the text to be placed is being retrieved from other areas
[quoted text clipped - 7 lines]
> I have looked in the help documentation but was not able to locate what I
> need. I appreciate all help given.