How To Delete All Comments In A Worksheet/Workbook ?


Microsoft Excel is a potent spreadsheet programme that enables users to efficiently store, arrange, and manipulate data. The ability to add comments to cells in Excel, which give context or more information about the data, is a useful tool. However, when your Excel document expands and changes, you might discover that you need to remove all comments from a worksheet or perhaps the entire workbook.

This tutorial will walk you through the process of deleting comments in Excel, whether you wish to do so to clean up your spreadsheet or to delete all comments for data privacy reasons. We'll look at two techniques− removing comments from a single worksheet and removing them from the entire workbook. You may effectively manage your comments by following the step−by−step directions provided here, and you can maintain neatness and organisation in your Excel files.

Delete All Comments In A Worksheet/Workbook

Here we will first create a VBA module, then run it to complete the task. So let us see a simple process to know how you can delete all comments in a worksheet or workbook.

Step 1

Consider any Excel sheet that contains multiple comments as similar to the below image.

First, right−click on the sheet name and select View Code to open a VBA application. Then, click on Insert and select Module, and copy the below code into the text box.

Code

Sub Remove_All_Comments_From_Worksheet()
   Cells.ClearComments
End Sub

Step 2

Then save the sheet as a macro−enabled template and click F5 to complete the task.

Note

If you want to delete comments in a workbook use the below code.

Code

Sub DeleteAllComments()
For Each xWs In Application.ActiveWorkbook.Sheets
   For Each xComment In xWs.Comments
      xComment.Delete
   Next
Next
End Sub

Conclusion

In this tutorial, we have used a simple example to demonstrate how you can delete all comments in a worksheet or workbook in Excel to highlight a particular set of data.

Updated on: 07-Jul-2023

50 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements