Extracting Comments Using Standard Excel Function

  • Thread starter Thread starter Leigh Kischke
  • Start date Start date
L

Leigh Kischke

Does anyone know if there is a way to extract the comments
from an Excel cell? I need to pull the comments out of
multiple cells and load them into the spreadsheet as real
data. Any help would be appreciated...
 
It works! Thanks Again!
-----Original Message-----
Here's a couple of steps to help ease you in..

Press Alt+F11 to go to vb editor

Click Insert>Module

Paste the "Function MyComment" copied from MVP Dave M's page in
the module page, i.e. the whitespace on the right pane.
(paste everything within the dotted lines below)

------------
Function MyComment(rng As Range)
Application.Volatile
Dim str As String
str = Trim(rng.Comment.Text)
'// If you want to remove Chr(10) character from string, then
str = Application.Substitute(str, vbLf, " ")
MyComment = str
End Function
---------------

Alt+Q to exit vb editor & return to excel

Now assume you have comments in A1 to be extracted to say, B1

Put in B1: =mycomment(A1)

B1 will give you the comments in A1




.
 
Back
Top