Need to clear or remove all comments in a workbook?
If time is not a constraint, comments can be deleted
manually.
To do it manually, is to right click on the cell that has a
comment and click "delete comment."
It’s not so hard, right?
What if there are 10 worksheets, in the workbook and every
worksheet has 20 or more comments?
Deleting the comments manually, would not be fun.
VBA is an ideal way to clear or remove comments the easy and
quick way.
Here's a simple VBA code to do it.
Don't run the code on production, and if the workbook and
the comments are quite important. But if you exactly know what you are doing,
go ahead.
Or save a copy of the workbook and do the test.
Once the comments are deleted it cannot be undone.
Copy and paste the code to the VBA editor.
=================================
Sub Delete_all_comments()
'VBA code below will delete all the comments
'For loop statement is 1 to 5
'Adjust the counter to the number of worksheets on the
workbook
For i = 1 To 5
With Worksheets(i)
Worksheets(i).Activate
ActiveSheet.Cells.ClearComments
End With
Next i
'Inform user operation is done
MsgBox "All comments gone"
End Sub
=================================
Click labels below for more VBA tips..
Cheers!! Enjoy, VBA is fun...
Comments
Post a Comment