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

Filtering for Comments

by Allen Wyatt
(last updated September 3, 2016)

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 are 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 dialog box. (See Figure 1.)
  4. Figure 1. The Go To dialog box.

  5. Click Special. Excel displays the Go To Special dialog box. (See Figure 2.)
  6. Figure 2. The Go To Special dialog box.

  7. Click the Comments radio button and then press Enter. Only those cells containing comments are selected.
  8. Type any number, character, or phrase not already present in the column.
  9. Press Ctrl+Enter. All the selected cells (those with comments) should now contain what you typed in step 6.
  10. 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.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11232) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Filtering for Comments.

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

Copying Comments when Filtering

The filtering feature in Excel allows you to quickly copy unique information from one data list to another. If you want to ...

Discover More

Conditional Formats for Odd and Even Columns

Setting up conditional formatting can be challenging under some circumstances, but once set it can work great. Unless, of ...

Discover More

Determining the Upper Bounds of an Array

When working with variables in a macro, you may need to know the upper boundary dimension for an array. This can be ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

MORE EXCELTIPS (RIBBON)

Locking the Size of Pictures in Comments

Excel allows you to place pictures inside of comments. If you do this, you may have experienced a situation where the size of ...

Discover More

Pasting a Comment into Your Worksheet

Excel allows you to not only put information into cells, but into comments attached to those cells. Here's how to copy the ...

Discover More

Editing a Comment Close to Its Cell

Have you ever chosen to edit a comment, only to find that the comment is quite a ways from the cell with which it is ...

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 for this tip:

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

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.

Links and Sharing
Share