Comments

J

jlschott2

How can I get a comment that I type in a cell to automatically appear or
automatically update in another cell?
I tried the simple, =a2, formula to have the info appear in b2 but it didn't
work.
 
A

Alan

As far as I know, a comment is just that, a comment in a cell. I don't think
you can get a comment in one cell to appear in, or alter the contents of
another cell,
Regards,
Alan.
 
D

Dave Peterson

Saved from a previous post:

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
 
Top