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: Copying Comments to Cells.

Copying Comments to Cells

by Allen Wyatt
(last updated February 26, 2021)

3

Hector has a large worksheet containing approximately 600 rows and 70 columns. Spread throughout these 43,000 cells are about 200 cells with comments. Hector wants to extract the comments and place them into cells to the right of the main body of the data table. If a comment, for instance, is attached to cell C43, then he'd like the text from that comment to end up in cell CC43 and the original comment to be deleted.

You might think that you could use Paste Special to perform the task, but that doesn't work. If you copy the original cells and then use Edit | Paste Special | Comments, then only the comments are pasted to the target cells. They are still comments, and not text in cells, which goes against Hector's goal.

The only way to handle this type of extraction is to use a macro. The following, when run on a selection of cells, will extract the comments, move the comment text, and then delete the original comment.

Sub CommentsToCells()
    Dim rCell As Excel.Range
    Dim rData As Excel.Range
    Dim sComment As String

    ' Horizontal displacement
    Const iColOffset As Integer = 78

    ' extract comments from selected range
    If TypeName(Selection) = "Range" Then
        Set rData = Intersect(Selection, ActiveSheet.UsedRange)
        For Each rCell In rData.Cells
            On Error Resume Next
            sComment = rCell.Comment.Text
            If Len(sComment) > 0 Then
                rCell.Offset(, iColOffset).Value = sComment
                rCell.Comment.Delete
            End If
            sComment = ""
            On Error GoTo 0
        Next
    End If
End Sub

The macro uses the iColOffset constant to specify how many cells to the right a comment's text should be moved. In this case, the offset (78) is equal to three "alphabets" (26 * 3), so the text of a comment originally in column C will end up in column CC.

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 (11837) 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: Copying Comments to Cells.

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

Replacing and Formatting at the Same Time

The Find and Replace feature in Word is very powerful. So powerful, in fact, that you can change the formatting on ...

Discover More

Printing a Font List

Getting a list of fonts available in a document is not something you can easily do in Word. That is, unless you put the ...

Discover More

Generating Random Testing Data

Need to test your formulas? Then you need some testing data that you can use to see if the formulas function as you ...

Discover More

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!

More ExcelTips (ribbon)

Managing Comments

If you frequently add comments to cells in a worksheet, Excel provides a variety of tools you can use to manage those ...

Discover More

Changing the Comment Indicator Color

Add a comment to a worksheet, and you'll notice that Excel places a small, red triangle at the upper-right corner of the ...

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 ...

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}] 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 nine more than 2?

2021-03-02 11:39:23

J. Woolley

You might be interested in the freely available ListComments array function in My Excel Toolbox. It works with threaded and unthreaded Comments/Notes.
See https://sites.google.com/view/MyExcelToolbox/
And did you know Comments can be included when a sheet is printed? See the Sheet tab of the full Page Layout > Page Setup dialog box.


2021-03-01 14:59:00

HECTOR SERRANO

I understood you published this Copying Comments to Cells a long time ago and fortunately, reprinted it last week. I had posed this problem several years ago, but unfortunately lost contact with your Excel Tips also for several years. What a big surprise to see the elegant and simple solution you just published. I will have the opportunity to apply it in a real case in a couple of weeks. Allen, I do appreciate very much your effort, time and concern for solving our Excel problems. Thank you. Hector.


2019-08-03 18:24:12

Frederick Rothstein

Here is another (shorter) macro that I think will also do what your macro does...

Sub CommentsToCells()
Dim Cell As Range

' Horizontal displacement
Const iColOffset As Integer = 78

' extract comments from selected range
On Error GoTo NoComments
For Each Cell In Selection.SpecialCells(xlComments)
Cell.Offset(, iColOffset).Value = Cell.Comment.Text
Cell.Comment.Delete
Next

NoComments:
End Sub


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.

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.