Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Pete at Sappi Fine Paper
 
Posts: n/a
Default 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   Report Post  
Gary L Brown
 
Posts: n/a
Default

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   Report Post  
Pete at Sappi Fine Paper
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
in cell comment BorisS Excel Discussion (Misc queries) 5 August 22nd 05 02:36 AM
displaying a comment only when the cell is selected Jeff Excel Discussion (Misc queries) 2 July 6th 05 09:21 AM
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
How do I copy text from a cell into a comment? Catnip Excel Discussion (Misc queries) 1 May 27th 05 02:12 PM
How can I move the comment box to the left of the cell? Frederic Excel Worksheet Functions 0 May 25th 05 02:25 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"