Extract comments (Not notes) from excel

IamLost

New Member
Joined
Jan 8, 2013
Messages
16
Hello, I have looked through the search and cant find anything, also google is not helping. I have inherited an excel spreadsheet which has a lot of data as well as a lot of comments. I am looking for a way to extract the comment into a new cell. Everything I read online refers to the "old" comments which are now called Notes I believe.

To simplify, I have a spreadsheet with for e.g. Column A has information in the cell as well as a comment. What I want to be able to do is run a macro to extract or copy the information in the comment and paste this in the cell to the right.

Any help would be much appreciated.
 
When you try the code does it work on your version?
Yup, the L3 is just a single comment & N7 has a reply.
1607957074129.png
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Thumbs up as a thank you and works for the Nots not comments.
Well my script was written for comments not Notes. I use Excel 2013 and am not familiar with Notes. So it's surprising my script works for Notes but not comments.
 
Upvote 0
@My Aswer Is This
The Comments you are referring are now called Notes (from 2016 onwards), which is why your code worked for them. What are now called Comments are something completely different.
 
Upvote 0
Well my script was written for comments not Notes. I use Excel 2013 and am not familiar with Notes. So it's surprising my script works for Notes but not comments.
There is obviously a bit of confusion, but as explained by Fluff.

Older versions of Excel called them Comments, These are now called Notes - This is what your code works on
In new versions of Excel, they created a new feature and called them comments. These are NOT the same as the old comments, but a new feature where you comment and respond on comments.
 
Upvote 0
Upvote 0
In case this is still relevant for anybody, this VBA code works for me for extracting the newer-style comments rather than old-style comments (now notes). It then dumps these into a new worksheet called 'Comments'


VBA Code:
Sub ExtractThreadedComments()
    Dim ws As Worksheet
    Dim threadedCmt As CommentThreaded
    Dim newWs As Worksheet
    Dim rowNum As Integer
    
    ' Set reference to Sheet1
    Set ws = ThisWorkbook.Sheets("Sheet1")
    
    ' Add a new worksheet for threaded comments
    Set newWs = ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
    newWs.Name = "Threaded Comments"
    
    ' Initialize row number
    rowNum = 1
    
    ' Loop through each threaded comment
    For Each threadedCmt In ws.CommentsThreaded
        newWs.Cells(rowNum, 1).Value = "Threaded Comment: " & threadedCmt.Text
        rowNum = rowNum + 1
        ' Loop through replies in the threaded comment
        For i = 1 To threadedCmt.Replies.Count
            newWs.Cells(rowNum, 1).Value = "Reply: " & threadedCmt.Replies(i).Text
            rowNum = rowNum + 1
        Next i
    Next threadedCmt
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top