ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   linking comments to appear in cell at same time (https://www.excelbanter.com/excel-discussion-misc-queries/40553-linking-comments-appear-cell-same-time.html)

MarkM

linking comments to appear in cell at same time
 
Is it possible to have comments for cells, appear in a seperate cells or
worksheet as data as they are added like link function ?

R.VENKATARAMAN

I have tried in some other work a code similar to the following code in vba

Range("d2") = Range("a1").Comment.Text

but I am not aware whether it can be linked. perhaps a event code with
sheet_change can be attempted.


MarkM wrote in message
...
Is it possible to have comments for cells, appear in a seperate cells or
worksheet as data as they are added like link function ?




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

MarkM wrote:

Is it possible to have comments for cells, appear in a seperate cells or
worksheet as data as they are added like link function ?


--

Dave Peterson


All times are GMT +1. The time now is 02:14 PM.

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