Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to count number of cells with comments in Excel?

Have you ever tried to count the number of comments in a worksheet? In this article, I will introduce you some quick tricks to count how many cells with comments in a worksheet.

Count number of cells containing comments with Go To Special function

Count number of cells containing comments with User Defined Function

Count number of cells containing comments with VBA code


arrow blue right bubble Count number of cells containing comments with Go To Special function


With the Go To Special feature in Excel, you can select all the comment cells first, and then view the count number in the status bar.

1. Go to click Home > Find & Select > Go To Special, see screenshot:

doc-count-comments-1

2. In the Go To Special dialog box, please check Comments option under Select section, see screenshot:

doc-count-comments-1

3. Then click OK button to close this dialog, and all the cells in active worksheet which contain the comment have been selected at once. And you can get the count number of the comments at the status bar. See screenshot:

doc-count-comments-1

Note: If you have blank cells with comments, the blank cell comments will not be counted.

Tip: You also can press Ctrl + G shortcuts to open Go To dialog, and click Special button to show Go To Special dialog.


arrow blue right bubble Count number of cells containing comments with User Defined Function

The above method has its own disadvantage, so, we can create a User Defined Function to count all the cell comments including the blank cell comments.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Count number of cells with comment

Function CountComments(xCell As Range)
'Update 20140924
    Application.Volatile
    CountComments = xCell.Parent.Comments.Count
End Function

3. Then save and close the code, go back to the worksheet, in a blank cell please enter this formula: =countcomments(A1), (A1 is a cell reference, you can change it to any other cell address ), see screenshot:

doc-count-comments-1

4. Then press Enter key, and you will get the number of cell comments.


arrow blue right bubble Count number of cells containing comments with VBA code

The following VBA code also can help you tocount all the cell comments including the blank cell comments.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Count number of cells with comment

Sub CountComments()
'Update 20140924
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set WorkRng = WorkRng.SpecialCells(xlCellTypeComments)
If VBA.Err > 0 Then
    MsgBox 0
Else
    MsgBox WorkRng.Count
End If
End Sub

3. Then press F5 key to run this code, and a prompt box will pop out to remind you to select a data range that you want to count the cell comments. See screenshot:

doc-count-comments-1

4. And then click OK, you will get the number of cell comments in the selection.

doc-count-comments-1


Related articles:

How to list all comments to a new worksheet or workbook in Excel?

How to find and replace text within comments in Excel?

How to quickly insert a comment to multiple cells in Excel?


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Ivan Meneses · 11 months ago
    Buenas tardes, me puede colaborar, que hacer para contar las celdas con comentarios dentro de un rango con Application.Volatile
  • To post as a guest, your comment is unpublished.
    ralph · 3 years ago
    sorry to say.. 9 of 10 times need the short 1 line answer.
    all this fancy dimm rap / buring the item need is just apita