Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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: Inserting Workbook Comments Into a Cell.

Inserting Workbook Comments Into a Cell

Written by Allen Wyatt (last updated August 12, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


4

Jim would like to insert the text found in the Comments portion of a workbook's properties into a cell. This isn't a comment attached to a cell, but the contents of the Comments field in the workbook properties.

If you need to simply copy the comments a single time, then doing so manually may be the best bet. You can display the Comments field, select whatever contents you want to put into your worksheet, and then press Ctrl+C. Close the properties, select the desired cell, and then press Ctrl+V.

If you have more of a need for the inclusion to be dynamic, then the only way to add those comments to a cell is to use a macro. If you want to have the contents appear in a specific cell (such as A1), then you can simply use a single line of code:

Range("A1")=ActiveWorkbook.BuiltinDocumentProperties("comments")

That's it; a single line of code to stuff the comments into the cell. You can build upon this, if desired, to create a user-defined function that is helpful for placing the comments anywhere you desire.

Function putComments() As String
    Application.Volatile
    putComments=ActiveWorkbook.BuiltinDocumentProperties("comments")
End Function

In order to use this user-defined function, simply use the following in a cell:

=putComments()

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 (12333) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Inserting Workbook Comments Into a Cell.

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

Moving Table Rows Quickly

One of the most esoteric shortcuts available in Word is one that allows you to move table rows, either within a table or ...

Discover More

Countering Compressed Columns

If you open a workbook and find that the width of some of your columns has been changed, the discovery can be ...

Discover More

Understanding Outlining

Outlining, a feature built into Excel, can be a great way to help organize large amounts of data. This tip provides an ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Changing Comment Color for a Single User

The default color used to format comments is determined by Windows, not Excel. You can adjust the formatting of ...

Discover More

Adding Comments to Protected Worksheets

When you protect a worksheet, Excel stops users from editing or otherwise making changes to the data in the worksheet. If ...

Discover More

Finding and Replacing Text in Comments

Excel allows you to add comments to individual cells in your workbook. Unfortunately, Excel doesn't provide a way to ...

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 9 + 4?

2023-08-21 11:09:36

J. Woolley

My Excel Toolbox includes the following function to set the text, numeric, logical, date/time, or error value of a workbook's document property and return confirmation:
=SetDocProperty(Name, Value, [AsDate], [Delete])
If built-in or custom document property Name exists, it will be set to Value; otherwise, a new custom document property Name will be added and set to Value.
If AsDate is TRUE, Value will treated as date/time; default is FALSE.
If Delete is TRUE, custom document property Name will be deleted; default is FALSE. A built-in document property cannot be deleted.
For example, the following formula will set the Comments built-in document property:
=SetDocProperty("Comments","This is my newest version.")
And this formula will add or update a custom document property:
=SetDocProperty("Latest revision","8/20/23 4:15 pm",TRUE)
The following dynamic array function lists built-in and custom (if any) document properties with 2 columns and N rows:
=ListDocProperties([SkipNull], [SkipCustom], [SkipHeader])
There are currently 34 built-in document properties in an Excel workbook.
The SpillArray function (described in UseSpillArray.pdf) simulates a dynamic array in older versions of Excel.
See https://sites.google.com/view/MyExcelToolbox


2023-08-14 14:32:36

J. Woolley

@Peter
As you notiiced in the Tip's title, it is about workbook comments, not worksheet comments.
My Excel Toolbox includes the following function to return the text of a comment associated with a Target worksheet cell:
=CommentText(Target,[SkipAuthor])
This works with either a legacy unthreaded comment (Note) or a threaded Comment. If SkipAuthor is FALSE (default), the comment's author will be included in the returned text if available; otherwise, the comment's author will be removed if possible. If Target is a multi-cell range, its top-left cell applies. If Target's cell does not have a comment, #VALUE! (Error 2015) will be returned.
The following dynamic array function is also included:
=ListComments([AllSheets],[Threaded],[SkipHeader])
This returns one row for each comment with the following columns: Worksheet, Cell, Author, Comment (text). It works for threaded or unthreaded comments. In older versions of Excel you can use ListComments with the SpillArray function described in UseSpillArray.pdf.
See https://sites.google.com/view/MyExcelToolbox


2023-08-13 21:23:25

Peter

The macro Allen provide will not display worksheet comments or notes.
Range("A1")=ActiveWorkbook.BuiltinDocumentProperties("comments") just returns an empty cell for my test workbook where I had a collection of Comments and Notes.
What you get by running this code is the Document Comments, that you find in Properties at at File>Info

Of course it is possible to write a macro function to extract comments for a given cell or range of cells either with or without the author's name.


2023-08-12 11:16:39

J. Woolley

Here are three ways to return the Comments field from the active workbook's document properties using functions available in My Excel Toolbox:
=INDEX(ListDocProperties(,,TRUE),5,2)
=VBAResult("ActiveWorkbook.BuiltinDocumentProperties(5)")
=VBAResult("ActiveWorkbook.BuiltinDocumentProperties(""Comments"")")
Notice "Comments" is the 5th item in BuiltinDocumentProperties.
See https://sites.google.com/view/MyExcelToolbox


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.