In this video, I will show you how to extract and display comments in Excel. These steps will work in older versions of Excel and in Excel 365.
Procedure:
1. Right on the sheet and select View Code.
2. Right click on your sheet, select Insert and then Module.
3. Copy, paste and save the VBA code below.
Function GetCommentText(rng As Range) As String
Dim cmt As String
On Error Resume Next
' Check for threaded comments (modern comments)
Dim threadedComment As CommentThreaded
Set threadedComment = rng.CommentThreaded
If Not threadedComment Is Nothing Then
cmt = threadedComment.Text
End If
' If no threaded comment, check for traditional comment (note)
If cmt = "" Then
cmt = rng.NoteText
End If
On Error GoTo 0
' If still no comment, set to "No comment"
If cmt = "" Then
GetCommentText = "No comment"
Else
GetCommentText = cmt
End If
End Function
4. Save your excel file as a macro-enabled file.
5. Type the following next to the cell you want the comment extracted.
=GetCommentText(A1)
#exceltips #exceltricks #exceltutorial