- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
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.
Sub Remove_All_Comments_From_Worksheet() Cells.ClearComments End Sub
Then save the sheet as a macro−enabled template and click F5 to complete the task.
If you want to delete comments in a workbook use the below code.
Sub DeleteAllComments() For Each xWs In Application.ActiveWorkbook.Sheets For Each xComment In xWs.Comments xComment.Delete Next Next End Sub
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.
Kickstart Your Career
Get certified by completing the courseGet Started