extracting a remark

  • Thread starter Thread starter Siny-j
  • Start date Start date
S

Siny-j

Hi ppl,

Another Q,

Is it possible to extract/place/copy the text which is in a remark in
another cell as plain text and not as a Remark, either by formula or
copying.

I know you can edit the Remark-box and then copy it, but that isn't
what i am looking for.


thx in advance
Siny-j
 
You can retrieve the text from a comment with a userdefined function like:

Option Explicit
Function GetComment(FCell As Range) As Variant
Application.Volatile

Set FCell = FCell(1)

If FCell.Comment Is Nothing Then
GetComment = ""
Else
GetComment = FCell.Comment.Text
End If

End Function

Then you can use it like any other function:

=getcomment(a1)

But be aware that the function won't evaluate when you just change the comment.
It'll be correct when excel recalculates. (Hit F9 to force a recalc.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Back
Top