Skip to main content

CommentsThreaded object

Table of contents
  1. Remarks
  2. Example

A collection of top-level CommentThreaded objects in a Worksheet, or a collection of replies in a single threaded comment.

Remarks

Each threaded comment is represented by a CommentThreaded object.

Example

Use the CommentsThreaded property of the Worksheet object to return the CommentsThreaded collection. The following example updates the text of all the threaded comments on worksheet one.

Set cmt = Worksheets(1).CommentsThreaded
For Each C In cmt
    C.Text "Updated Comment"
Next

Use the AddCommentThreaded method of the Range object to add a threaded comment to a range. The following example adds a threaded comment to cell E5 on worksheet one.

Worksheets(1).Range("e5").AddCommentThreaded("This is a Threaded Comment")

Use CommentsThreaded (index), where index is the threaded comment number, to return a single threaded comment from the CommentsThreaded collection. The following example updates the text of threaded comment two on worksheet one.

Worksheets(1).CommentsThreaded(2).Text "Updated Text"

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>