Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 1.53 KB

Excel.Comments.md

File metadata and controls

67 lines (44 loc) · 1.53 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Comments object (Excel)
vbaxl10.chm513072
vbaxl10.chm513072
Excel.Comments
f43bf021-1e46-10cf-09bf-070fc6a2c81a
03/29/2019
medium

Comments object (Excel)

A collection of cell comments.

Remarks

Each comment is represented by a Comment object.

Example

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

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

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

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

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

Worksheets(1).Comments(2).Visible = False

Methods

Properties

See also

[!includeSupport and feedback]