Delete all Comments in Microsoft Excel

In Excel, while preparing reports for boss/management, we tend to insert comments in order to let the other person inform the status of the task. Comments are basically used for internal purpose. In this article, we will learn how to remove all comments in Excel, using macros.

Question): I would like to apply a VBA code that will remove all the comments from workbook.

I am using Excel 2003 version at my home & Excel 2010 version at office. I have a code that is perfectly running in deleting Excel 2010 comments but not able to delete Excel 2003 comments.

We need to follow the below steps:

  • Click on Developer tab
  • From Code group, select Visual Basic

image 1

 

  • Click on Insert, and then Module

image 2

 

  • This will create new module
  • Enter the following code in the standard module

The following code is compatible with Excel 2007, Excel 2010 & Excel 2013 version

Sub Remove_Comments_After2007()

' Remove Comments from Excel 2007 Workbook

ActiveWorkbook.RemoveDocumentInformation (xlRDIComments)

End Sub

The following code is compatible with Excel 2003 version

Sub Remove_Comments_2003()

' Remove Comments from Excel 2003 Workbook

Dim wksAs Worksheet

Dim cmnt As Comment

    For Each wksInActiveWorkbook.Sheets

        For Each cmntInwks.Comments

cmnt.Delete

        Next cmnt

    Next

End Sub

image 3

 

  • To run the macro, we will press ALT + F8 shortcut key to open Macro window & select the macro.
  • All the comments will get deleted.

In this way, we can delete Excel comments depending on the versions we are using.

download

Excel

 

Users are saying about us...

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Google PlusVisit Us On Youtube