Forum Discussion
kwilkies
Feb 25, 2022Copper Contributor
Copying the value of Comment into a cell
I have a large spreadsheet that I have to change to make it much more "user friendly" for folks who are not so familiar with Excel. This sheet has over 100 "comments" that I need to translate into r...
amit_bhola
Feb 25, 2022Iron Contributor
kwilkies This VBA code will extract the comments into the cells containing the comment. It will replace any existing contents of the cells with the comment text, so be careful / save a back-up copy of your file before trying it.
Example file with steps to follow is attached.
Sub ExtractComments()
If Not TypeName(Selection) = "Range" Then Exit Sub
Dim rng As Range
Set rng = ActiveWindow.RangeSelection
On Error Resume Next
For Each c In rng.Cells
c.Value = c.Comment.Text
Next
End Sub
- KiviShapiroJan 24, 2024Copper ContributorVery nice!
A note for folks using Microsoft 365: if the above isn't working, then try replacing "Comment" with "CommentThreaded".