Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to convert comments to cell contents in Excel?

Supposing I have a range cells filled with comments in a worksheet, and now, I want to convert all of the comments to cell contents so that I can print them neatly and roundly. Are there any good ways to solve this task?

Convert comments to cell contents with User Defined function

Convert comments to cell contents with VBA code

Convert comments to cell contents with Kutools for Excel

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words...
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum...
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns...
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Create Mailing List and Send Emails by Cell's Value...
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

arrow blue right bubble Convert comments to cell contents with User Defined function


By using this method, you need to create a defined function first, and then apply the defined formula to convert the comments to cell contents. You can finish it as the following steps:

1.Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following function into the Module:

Function GetComments(pRng As Range) As String
'Updateby20140509
If Not pRng.Comment Is Nothing Then
    GetComments = pRng.Comment.Text
End If
End Function

2.Press Ctrl + S to save the function.

3.Then input the following formula “=GetComments(A1 )” in any blank cell, in this case, I will use cell E1. See screenshot:

doc-comments-to-cells1

4. Press the Enter key. And select cell E1, then drag the fill handle over the range of cells that you want to contain this formula. And all of the comments are converted to cell contents. See screenshot:

doc-comments-to-cells2


arrow blue right bubble Convert comments to cell contents with VBA code

If you know the VBA code, the following brief code also can help you to convert comments to cell contents.

1. Select the range that you want to convert to cell contents;

2. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:

Sub CommentToCell()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
    Rng.Value = Rng.NoteText
Next
End Sub

3. Then click  doc-multiply-calculation-3 button to run the code. And select a range you want to convert then click OK, and all of the selected comments have been converted to cell contents in its relevant cells.


doc-comments-to-cells3 -2 doc-comments-to-cells4

Note: If you don’t want the comments, you can delete them.


arrow blue right bubble Convert comments to cell contents with Kutools for Excel

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.Get it Now .

The Convert Comment and Cell of Kutools for Excel is a handy and useful tool can help you to solve many problems about comments.

After installing Kutools for Excel, please do as follows:

1. Select the range that you want to import the comments into the cells.

2. Click Kutools > More > Convert Comment and Cell, see screenshot:

doc-comments-to-cells-5

3. In the Convert Comment and Cell dialog box, select Convert comments into content of cells. See screenshot:

doc-comments-to-cells-6

4. Then click OK. Now all of the selected comments are converted to cell contents in its original range.

For more detailed information about Convert Comment and Cell, please visit Convert Comment and Cell feature description.


Related articles:


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Tim · 11 months ago
    is there a way to do this without the title of a comment or the non bold writing?
  • To post as a guest, your comment is unpublished.
    Raymond Bergmark · 1 years ago
    Great tip, thanks for sharing!
  • To post as a guest, your comment is unpublished.
    Nikhil · 2 years ago
    Perfect! Thank You
  • To post as a guest, your comment is unpublished.
    Eric · 2 years ago
    You are a star!!! thanks
  • To post as a guest, your comment is unpublished.
    Lis · 2 years ago
    It does not automatically update when I change the comment. How do I change this?
    Thanks
  • To post as a guest, your comment is unpublished.
    Casey Norman · 2 years ago
    You are my HERO!!!!!!!!!!!!!!!!!!!!!! Thank You Thank You Thank You
  • To post as a guest, your comment is unpublished.
    Henrique · 2 years ago
    Hi.
    I tried this code and it worked right. But I have a little problem: can I use this code combined with VLOOKUP? I tried but I didn't get anything.
    If you can help me, I'll be thankful.
    I'm brazilian. If I wrote something wrong, I apologise.
    Thanks!
  • To post as a guest, your comment is unpublished.
    Szpepa · 2 years ago
    It's worked :)
    Thanks!
    Good job
  • To post as a guest, your comment is unpublished.
    Graham · 3 years ago
    The 1400 cell comments took but a few minutes. Wow!
    Thank you.
  • To post as a guest, your comment is unpublished.
    Arul · 3 years ago
    good job thank u so much
  • To post as a guest, your comment is unpublished.
    Paresh · 3 years ago
    Hi!

    Awesome, thank you so much for this post! It helped me save a day! :)

    Thanks!
  • To post as a guest, your comment is unpublished.
    Al Conte · 4 years ago
    Does not seem to work. I am using Office 2013 on Windows 7. I get #Name ?

    Any clues as to what I should do? Do I have to change any elements of the code for Office 2013 version of Excel?

    Thanks
  • To post as a guest, your comment is unpublished.
    mansour sadeghi · 4 years ago
    you are great
    excellent
    thank you very much
    thank you
  • To post as a guest, your comment is unpublished.
    AusSteelMan · 5 years ago
    Hi,
    When i run the code "Convert...VBA code" above I get an odd outcome.
    For a range of cells (B2:N2) each that have comment texts (that are a formula), when the ode runs it works properly only for ColB, ColD, ColF, ColH, ColJ, ColL, ColN - every second column!
    If I run it just for ColB it works. But if I run it for ColC it does not. Note: the formulas are almost identical.
    The cell simply has no value/string from the comment (so i don't think it is a formula issue.
    Same applies to every other column. If it worked in the range it works on its own and not if it didn't.
    Any suggestions?

    Before I post, I thought I'd try a new workbook as a test.
    In A1 entered a formula "=ROW()+COLUMN()". Filled to range C3.
    Ran this code:
    Public Sub CellFormulaToCellComment()
    'Written by: Darren R.... 05 Nov 2014
    'Will copy the cell formula to the cell comments
    'Note: will delete any existing comments, so be careful

    Dim CellInRange As Range
    Dim CellComment As String

    For Each CellInRange In Selection
    If CellInRange.HasFormula Then
    CellComment = CellInRange.Formula
    CellInRange.ClearComments
    CellInRange.AddComment (CellComment)
    End If
    Next
    End Sub
    to copy the formulas into the comments for each cell.
    Copy PasteSpecial Comments into D4:F6.
    Now have empty cells with comments
    Then ran the "CommentToCell" sub and it worked in every cell.
    So now I am really stumped.

    Furthermore, I found some info about NoteText being outdated and replaced with Cell.Comment but swapping out the commands didn't work and I wasn't sure how to change it all to work

    Any thoughts would be appreciated.
    Thanks,
    Darren
  • To post as a guest, your comment is unpublished.
    Arthur · 5 years ago
    I always thought I know most things about Excel. But I never knew that you can write and use user defined functions as if they were native to Excel. Thank you for my lesson of the day.
  • To post as a guest, your comment is unpublished.
    Phil Payne · 5 years ago
    Worked at first but then returned a #NAME? error.
  • To post as a guest, your comment is unpublished.
    Phil Payne · 5 years ago
    "Convert comments to cell contents with User Defined function"

    At first this worked and I saved the workbook and closed it. The next time I opened the work book every cell which previously shown cell comments correctly now shows #NAME? error!

    How can this be prevented?
  • To post as a guest, your comment is unpublished.
    Sean · 5 years ago
    Works great, what a nice solution! Thanks.
  • To post as a guest, your comment is unpublished.
    Stephen · 5 years ago
    God you are a saviour!!!! thanks for this.
  • To post as a guest, your comment is unpublished.
    Ron Mote · 5 years ago
    I haven't tried this yet but it appears to do exactly what I need to do. Thanks