Class Comment (Excel VBA)

The class Comment represents a cell comment.

The main procedure of class Comment is Delete

Set

To use a Comment class variable it first needs to be instantiated, for example

Dim cmm as Comment
Set cmm = ActiveCell.Comment

The following procedures can be used to set variables of type Comment: Next, Previous, Comments.Item, Range.Comment, Range.AddComment and Worksheet.Comments

For Each

Here is an example of processing the Comment items in a collection.

Dim cmm As Comment
For Each cmm In Application.Comments
	
Next cmm

Methods

This is the main method of the Comment class

Delete - Deletes the object.

ActiveCell.Comment.Delete

Other Methods

Next - Returns a Comment object that represents the next comment.

Previous - Returns a Comment object that represents the previous comment.

Text - Sets comment text.

Comments.Item - Returns a single object from a collection.

Properties

Author returns the author of the comment.

Parent returns the parent object for the specified object. Read-only.

Shape returns a Shape object that represents the shape attached to the specified comment.

Visible returns or sets a Boolean value that determines whether the object is visible.

Comments.Count returns a Long value that represents the number of objects in the collection.

Comments.Parent returns the parent object for the specified object. Read-only.