Sanjib would like to get a count of all the comments in a worksheet. Unfortunately, Excel doesn't include a function that allows you to access this information. You can, however, get the value manually by using this process:
Figure 1. The Go To Special dialog box.
If you want to get the number of comments and place it into a cell, then you need to use a macro to create a user-defined function.
Function CountComments(rCell As Range) Application.Volatile CountComments = rCell.Parent.Comments.Count End Function
This function grabs the value of the Count property for the Comments collection. It is then returned by the function to the worksheet. To use it in your worksheet, enter a formula such as the following:
=CountComments(A1)
The cell address you use in the formula is unimportant; it should simply reference a cell on the worksheet for which you want the count.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6932) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Counting Comments in a Worksheet.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
If you frequently add comments to cells in a worksheet, Excel provides a variety of tools you can use to manage those ...
Discover MoreNormally Excel displays comments in a color reminiscent of sticky notes you keep around your office. If you want them to ...
Discover MoreAdding a comment to a single cell is easy. What if you want to add the same comment to multiple cells, however? Here are ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2020-01-25 08:44:56
Fiaz Idris
There is a problem with the count using status bar. When the Cell is Empty but with comments, that cell is NOT counted.
So, you will receive less count than the actual number of comments in cases.
To avoid this problem, after Step 4, when all the cells are selected, Type: "aaa" (some random text), and press Ctrl+Enter. This will add text "aaa" to all the comment cells.
Now every comment cell has a value and the count of comments will now be correct in status bar. Hope this helps!
2018-10-13 11:17:06
Rick Rothstein
There is no need to include the Application.Volatile code line as inserting and deleting comments does not trigger any events that Excel monitors, so your CountComments formula will work like Excel's CELL function... it will not update until the worksheet is recalculated.
Also, you can eliminate the need for having to pass a cell reference to the function by making use of the Application.Caller object. The following function will work like the one you posted, but no argument should be passed to it.
Function CountComments() As Long
CountComments = Application.Caller.Parent.Comments.Count
End Function
And you would simply call it like this...
=CountComments()
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments