Skip to main content

Range.AddComment method

Adds a comment to the range.

Syntax

expression.AddComment (Text)

expression A variable that represents a Range object.

Parameters

Name Required/Optional Data type Description
Text Optional Variant The comment text.

Return value

Comment

Example

This example adds a comment to cell D4 on worksheet one.

Worksheets(1).Range("D4").AddComment "Current Sales"

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>