Today, you’ll learn how to delete threaded comments in Excel in cool and intuitive ways!
Deleting threaded comments in Excel is like cleaning up a busy email thread in your inbox. While the threaded format helps keep discussions organized, outdated or irrelevant comments can create unnecessary clutter.
Managing them might seem daunting if you don’t know the right steps. In this Excel tutorial, I’ll tutorial simplify the process through multiple methods, providing you with clear, actionable instructions to tidy up your Excel sheets. Let’s get started!
Using the Review Tab
The default Comments command block that allows you to manage threaded comments in Excel is in the Review tab.
Select the dataset containing comments and navigate to the Review tab from the Excel ribbon menu.
Click on the Delete command in the Comments block.
This action will erase all the comments.
If you wish to remove a specific comment, select the source cell, and click on the Delete button in the Comments block.
Sometimes, you might want to use a keyboard shortcut. For that, select one or many cells containing threaded comments and press the Alt + R + D keys to remove the selected comments.
Using the Right-Click Menu
By default, Excel shows active threaded comments by using a five-sided purple shape and resolved comments using a five-sided dark shape in the top right corner of the source cell.
So, you can use such markings on a cell in the worksheet to locate a comment and select it.
Right-click and select the Delete Comment option from the context menu.
Using the Clear Command
The Clear command of the Editing block in the Home tab is yet another effortless way to delete comments and notes from one or many worksheets.
Select one or many cells containing comments in the active worksheet and click on the Clear drop-down menu in the Editing block.
Select the Clear Comments and Notes command to delete threaded comments.
Suppose, you’d like to delete comments simultaneously from more than one worksheet in the same workbook.
Select the same cell range in multiple worksheets.
Hit the Ctrl key and click once on the rest of the sheet names in the Sheet tab section at the bottom of the workbook. Don’t forget to exclude those worksheets where you don’t want to perform this action.
Use the Clear Comments and Notes command from Editing > Clear drop-down menu in the Home tab.
Using the Comments Button
If you’re using the latest Excel 365 Windows, Mac, or web app, you should see the Comments button in the top right corner, just below the Close window button.
Click on that to open a right-side navigation panel showing all the threaded comments from the active worksheet.
Select the More thread actions icon on a comment you wish to delete and click on the Delete thread command in the context menu that shows.
Using Excel VBA
If you’re looking for a fully automated way to delete comments you can set up a VBA macro using a simple VBA script. When you build a macro, you just need to run it and follow a few visual instructions to successfully remove unwanted threaded comments.
The upside of this method is you don’t need to remember any commands or their steps. Instead, you just need to know the name of the macro that removes comments. Also, this method is compatible with most Windows and macOS Excel releases.
⚠️ Warning: When you run a VBA script and make any changes in the worksheet, you can’t use the Excel undo feature to revert the changes. So, create a backup of the workbook before trying out this technique.
Before you can begin setting up the macro, go through this quick and easy Excel tutorial to learn how to build a macro in Excel:
📒 Read More: How To Use The VBA Code You Find Online
If you’re ready to proceed, use the following VBA script to create a Macro in the workbook where you wish to run it:
Sub DeleteThreadedComments()
Dim ws As Worksheet
Dim cell As Range
Dim prompt As String
Dim response As Integer
Dim inputRng As Range
Dim countDeleted As Integer
prompt = "Do you want to delete threaded comments from one worksheet or all worksheets?" & vbCrLf & vbCrLf & "1 - One worksheet" & vbCrLf & "2 - All worksheets"
response = Application.InputBox(prompt, "Delete Threaded Comments", Type:=1)
If response = 1 Then
' Ask for the range in the active worksheet
On Error Resume Next
Set inputRng = Application.InputBox("Select the range with threaded comments to delete:", "Delete Threaded Comments", Type:=8)
On Error GoTo 0
If inputRng Is Nothing Then
MsgBox "No range selected.", vbExclamation
Exit Sub
End If
countDeleted = 0
' Delete comments in the selected range
On Error Resume Next
For Each cell In inputRng
cell.ClearComments
If Err.Number = 0 Then
countDeleted = countDeleted + 1
End If
Err.Clear
Next cell
On Error GoTo 0
MsgBox countDeleted & " threaded comments deleted from the selected range.", vbInformation
ElseIf response = 2 Then
' Delete comments in all worksheets
countDeleted = 0
On Error Resume Next
For Each ws In ThisWorkbook.Worksheets
For Each cell In ws.UsedRange
cell.ClearComments
If Err.Number = 0 Then
countDeleted = countDeleted + 1
End If
Err.Clear
Next cell
Next ws
On Error GoTo 0
MsgBox countDeleted & " threaded comments deleted from all worksheets.", vbInformation
Else
MsgBox "Invalid choice. Please enter 1 or 2.", vbExclamation
End If
End Sub
When the VBA macro is ready, press Alt + F8 to bring up the Macro dialog box.
Click on the DeleteThreadedComments macro and hit the Run button.
As soon as you execute the macro, Excel will show a dialog box where you need to enter any of the following values:
- Press
1
to choose a cell range manually from any one worksheet of the active workbook. - Press
2
to delete all comments from all the worksheets of the active workbook.
When you type 2
, Excel deletes all threaded comments from the entire workbook.
However, if you type 1
, you’ll get another input box where you can type in the selected cell range from any worksheet or use the mouse to choose the input cell range.
When the task is complete, the VBA macro will show a confirmation dialog box.
Using Office Scripts
The latest Excel desktop app for Microsoft 365 comes with Office Scripts, a much more efficient and lightweight programming tool than Excel VBA. It runs on both desktop and online Excel apps. The best thing is it allows you to modify Excel workbooks in your Microsoft 365 OneDrive storage remotely using Power Automate flows.
Look for the Automate tab in the Excel ribbon area. If you do, you can follow the rest of the steps mentioned below.
Click on the New Script command in the Scripting Tools block.
The Office Scripts Code Editor will show up on the right side as a sidebar.
It might contain a dummy or test code.
Select the content of Code Editor and hit Delete.
Now, copy and paste the following script inside the Code Editor interface:
function main(workbook: ExcelScript.Workbook) {
// Get all worksheets in the workbook
let sheets = workbook.getWorksheets();
// Iterate through each worksheet
sheets.forEach(sheet => {
// Get all comments in the current worksheet
let comments = sheet.getComments();
// Iterate through each comment and delete it
comments.forEach(comment => {
comment.delete();
});
});
}
Click on the More options icon just above the script area and select Rename.
Enter a name you can remember. For example, type Delete threaded comments active sheet
, and click anywhere except the name field to automatically save the Office Script code.
You can now hit the Run button to erase all the comments from the active worksheet.
Suppose, you’d like to delete all comments from the workbook in one go. In that case, use the following Office Scripts code to create another automated script-based action:
function main(workbook: ExcelScript.Workbook) {
// Get all worksheets in the workbook
let sheets = workbook.getWorksheets();
// Iterate through each worksheet
sheets.forEach(sheet => {
// Get all comments in the current worksheet
let comments = sheet.getComments();
// Iterate through each comment and delete it
comments.forEach(comment => {
comment.delete();
});
});
}
📚 Read more: If you’ve successfully learned how to delete a threaded comment in Excel following this tutorial, you’ll also find these resources useful:
Conclusions
If you were struggling with hundreds of threaded comments, it should have ended now that you’re at the end of the tutorial. Now you know all the proven and efficient methods to remove comments that you don’t need or all comments in one go.
You can begin with methods like the Review tab and its shortcut, the right-click menu, the Clear button in Home, and the Comments option in the top right corner. These are a bit manual but won’t let you down if you occasionally need to remove a few comments.
However, if you’d like to automate the process, you can choose Excel VBA for earlier editions and Office Scripts for Excel 365 desktop or web app.
If this Microsoft Excel guide helped you to acquire a new spreadsheet management skill, you can share your acknowledgment in the comment box.
0 Comments