ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   extracting comments (https://www.excelbanter.com/excel-worksheet-functions/5241-extracting-comments.html)

Ralph Heidecke

extracting comments
 
is there a way to extract the comments associated with a cell and display
them in another cell via a formula?



Frank Kabel

Hi
this would require VBA. Not possible with formulas alone

--
Regards
Frank Kabel
Frankfurt, Germany

"Ralph Heidecke" schrieb im Newsbeitrag
...
is there a way to extract the comments associated with a cell and

display
them in another cell via a formula?




Dave Peterson

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

Ralph Heidecke wrote:

is there a way to extract the comments associated with a cell and display
them in another cell via a formula?


--

Dave Peterson



All times are GMT +1. The time now is 04:55 AM.

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