Hide all comments in a worksheet

How to hide all comments in a worksheet using VBA

METHOD 1. Hide all comments in a worksheet using VBA

VBA

Sub Hide_all_Comments_in_a_Worksheet()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
Set cellcommentrng = ws.Cells.SpecialCells(xlCellTypeComments)
'hide all comment in a worksheet named Analysis
For Each cellrng In cellcommentrng
cellrng.Comment.Visible = False
Next

End Sub

OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
PREREQUISITES
Worksheet Name: Have a worksheet named Analysis.

ADJUSTABLE PARAMETERS
Worksheet Selection: Select the worksheet in which you want hide all comments by changing the Analysis worksheet name, in the VBA code, to any worksheet in the workbook.

Explanation about how to hide all comments in a worksheet

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to hide all comments in a worksheet using VBA.

VBA Methods: Using VBA you can hide all comments in a worksheet by specifying the worksheet in which to hide all comments.