Remarks

Each comment is represented by a object.

Example

Use the Comments property to return the Comments collection. The following example hides all the comments on worksheet one.

Visual Basic for Applications
Set cmt = Worksheets(1).Comments For Each c In cmt c.Visible = False Next

Use the method to add a comment to a range. The following example adds a comment to cell E5 on worksheet one.

Visual Basic for Applications
With Worksheets(1).Range("e5").AddComment .Visible = False .Text "reviewed on " & Date End With

Use Comments(), where is the comment number, to return a single comment from the Commentscollection. The following example hides comment two on worksheet one.

Visual Basic for Applications
Worksheets(1).Comments(2).Visible = False
Comments Collection comments collection object General description of comments collection?

See also:

index index