Hide all comments in a worksheet
How to hide all comments in a worksheet using VBA
Sub Hide_all_Comments_in_a_Worksheet()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
Set cellcommentrng = ws.Cells.SpecialCells(xlCellTypeComments)
Set cellcommentrng = ws.Cells.SpecialCells(xlCellTypeComments)
'hide all comment in a worksheet named Analysis
For Each cellrng In cellcommentrng
cellrng.Comment.Visible = False
Next
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.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
PREREQUISITES
Worksheet Name: Have a worksheet named Analysis.
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
This tutorial explains and provides step by step instructions on how to hide all comments in a worksheet using VBA.
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.