Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Filtering for Comments (Notes).

Filtering for Comments

Written by Allen Wyatt (last updated March 11, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


6

Robert has a worksheet that has comments included in various places. He wonders if it is possible to filter the rows in a data table so that only those rows that include comments in a particular column will be displayed.

The filtering capabilities of Excel don't provide a way that you can automatically check for the presence of comments, but there are a couple of ways you can approach a solution. One possible solution is to follow these general steps:

  1. Make a copy of the column that contains comments to be filtered.
  2. Select the duplicate column.
  3. Press F5 to display the Go To tab of the Find and Replace dialog box.
  4. Click Special. Excel displays the Go To Special dialog box.
  5. Click the Comments radio button and then press Enter. Only those cells containing comments are selected.
  6. Type any number, character, or phrase not already present in the column.
  7. Press Ctrl+Enter. All the selected cells (those with comments) should now contain what you typed in step 6.
  8. Use AutoFilter to display only those rows that contain whatever you typed in step 6.

If you prefer, you can create a user-defined function that will let you know if a particular cell has a comment associated with it. The following is a simple way to make such a determination:

Function CellHasComment(c As Range)
    Application.Volatile True
    CellHasComment = Not c.Comment Is Nothing
End Function

Now you can use a formula such as the following within a worksheet:

=CellHasComment(B2)

When the formula is executed, it returns either True or False, depending on whether cell B2 has a comment or not. You can then use Excel's filtering capabilities to display only those rows that have a True returned by the formula.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3508) 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: Filtering for Comments (Notes).

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Saving Portions of Files

Want to save snippets from a document into individual files? There are a couple of easy ways to achieve this goal, as ...

Discover More

Turning on Picture Placeholders

Displaying graphics in a document requires a great deal more computer processing than displaying simple text. A document ...

Discover More

Breaking Into Sentences

Macros allow you to easily extend what you can do with Word. If you have a common editing task, that task can often be ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Counting Filtered Rows

The filtering capabilities of Excel are indispensable when working with large sets of data. When you create a filtered ...

Discover More

Removing Duplicates Based on a Partial Match

Some types of data may have certain fields that contain partially identical information. In such cases you may want to ...

Discover More

Recalculating when Filtering

Filter a large worksheet, and Excel will helpfully recalculate every time you apply a different filter. This can get ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

2019-11-04 03:07:23

Peter McNab

It would be more useful to return the actual comment, then you could do much more with your filter.
I think you will need to recalculate the cell/sheet for the formula to evaluate if you edit the cell.

It gets a bit messy in the current version of Excel since notes in a cell are comments in VBA. To read a note, I use range.Comment.Text. To read a comment it sees you need to use range.CommentThreaded.Text


2019-11-02 05:27:27

Sona Mishra

thanks


2019-10-15 09:43:09

Sander

Yes indeed! Or when all 'comments' cells are selected with the Go To function you can give them a color and use the color filter.


2019-03-14 12:14:15

Martin

I see only Note radio button why am I missing the Comments radio button how can I bring it up?


2018-10-15 13:50:25

Chuck

This is a fabulous tip. Thank you very much for sharing!


2018-10-04 17:28:24

Jodie

Thanks for your help Allen, this tip was a lifesaver!


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.