Extract Comments and place as a value in another cell

Kathleen_0422

Board Regular
Joined
May 5, 2011
Messages
64
Hello All,

I am working with Excel 2003

My Questions is:

I have a large spreadsheet close to 17000 rows. In column K there are comments embedded within the cells.

I would like to copy the text of the comment and place it in Column A on the same row. Is there a formula I can use to do so?

Thanks for your help
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Kathleen & Welcome to the Board,

A UDF will perform this task for you:

Code:
[FONT=Arial]Function GetCommentText(rCommentCell As Range)[/FONT]
[FONT=Arial]Dim strGotIt As String[/FONT]
[FONT=Arial]   On Error Resume Next[/FONT]
[FONT=Arial]   strGotIt = WorksheetFunction.Clean _[/FONT]
[FONT=Arial]             (rCommentCell.Comment.Text)[/FONT]
[FONT=Arial]   GetCommentText = strGotIt[/FONT]
[FONT=Arial]   On Error GoTo 0[/FONT]
[FONT=Arial]End Function[/FONT]

In A1 type =GetCommentText(K1)

Post back if you need anything further
HTH
Ian
 
Upvote 0
You will need a macro for that. Press ALT + F11 to open the Visual Basic Editor, select Module from the Insert menu and paste into the white space on the right

Code:
Sub cmts()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
    If cmt.Parent.Column = 11 Then cmt.Parent.Offset(, -10).Value = cmt.Text
Next cmt
End Sub

Press ALT + Q to close the code window, press ALT + F8, click on cmts then click the Run button.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,855
Members
452,948
Latest member
UsmanAli786

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