Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to set cell to a comment from another cell?
How do I make one cell equal to the comment in another cell? One would think
that =comment(A1) would do it, but of course it doesn't. Can anyone help? |
#2
|
|||
|
|||
You need a UDF (User Defined Function). Copy the UDF below...
'/=======================================/ Public Function Comment(rng As Range) 'rng must point to a single cell 'Get Text in a comment of one (1) cell Application.Volatile On Error GoTo err_Function Comment = rng.Comment.Text exit_Function: On Error Resume Next Exit Function err_Function: GoTo exit_Function End Function '/=======================================/ HTH, -- Gary Brown If this post was helpful, please click the ''''Yes'''' button next to ''''Was this Post Helpfull to you?". "Pete at Sappi Fine Paper" wrote: How do I make one cell equal to the comment in another cell? One would think that =comment(A1) would do it, but of course it doesn't. Can anyone help? |
#3
|
|||
|
|||
Thanks! I actually wrote a program to populate all the cells in my sheet
with the comments in the cells on another sheet, and now that I've written it I might as well stick with it. However, now that you've taught me how to use UDFs, I'll no doubt do so frequently in future! Thanks very much! "Gary L Brown" wrote: You need a UDF (User Defined Function). Copy the UDF below... '/=======================================/ Public Function Comment(rng As Range) 'rng must point to a single cell 'Get Text in a comment of one (1) cell Application.Volatile On Error GoTo err_Function Comment = rng.Comment.Text exit_Function: On Error Resume Next Exit Function err_Function: GoTo exit_Function End Function '/=======================================/ HTH, -- Gary Brown If this post was helpful, please click the ''''Yes'''' button next to ''''Was this Post Helpfull to you?". "Pete at Sappi Fine Paper" wrote: How do I make one cell equal to the comment in another cell? One would think that =comment(A1) would do it, but of course it doesn't. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
in cell comment | Excel Discussion (Misc queries) | |||
displaying a comment only when the cell is selected | Excel Discussion (Misc queries) | |||
Cell color based upon cell value | Excel Discussion (Misc queries) | |||
How do I copy text from a cell into a comment? | Excel Discussion (Misc queries) | |||
How can I move the comment box to the left of the cell? | Excel Worksheet Functions |