ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   reference to Comments (https://www.excelbanter.com/excel-programming/292325-reference-comments.html)

Thomas Eggenschwiler

reference to Comments
 
How can I create a reference (in cell A1) to comments I inserted in
cell A2? Or asking the question in a different way: Can I display the
comments from cell A2 in cell A1 by referring to the comments of cell
A2 (not the value in cell A2)?
Thanks

Tom Ogilvy

reference to Comments
 
Public Function ShowComments(rng as Range)
Application.Volatile
On error resume next
set cmt = rng(1).Comment
On Error goto 0
if not cmt is nothing then
ShowComments = cmt.Text
else
ShowComments = ""
end if
End Function

=showcomments(E5)

Won't update until there is a calculation.

--
Regards,
Tom Ogilvy


"Thomas Eggenschwiler" wrote in message
om...
How can I create a reference (in cell A1) to comments I inserted in
cell A2? Or asking the question in a different way: Can I display the
comments from cell A2 in cell A1 by referring to the comments of cell
A2 (not the value in cell A2)?
Thanks




Ko Vijn[_3_]

reference to Comments
 
Thomas,
try this:
Read the comment from cell A2 by:
MyComment = split(range("a2").Comment.Text,":")(1)

Stick it in cell A1:
Range("a1") = Mycomment

The split statement will take off the Username that comes with the comment.

Ko Vijn

"Thomas Eggenschwiler" schreef in
bericht om...
How can I create a reference (in cell A1) to comments I inserted in
cell A2? Or asking the question in a different way: Can I display the
comments from cell A2 in cell A1 by referring to the comments of cell
A2 (not the value in cell A2)?
Thanks





All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com