Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default copy comment content to cell content as data not as comment

How do I copy comment content to cell content as data and not as comment?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default copy comment content to cell content as data not as comment

Say you have a comment in Cell C6 and A1 is your Target for the Comment text

Sub foo()
Range("A1").Value = Application.Range("C6").Comment.Text
End Sub

"Lilach" wrote:

How do I copy comment content to cell content as data and not as comment?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default copy comment content to cell content as data not as comment

You have to use a macro:


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

Lilach wrote:

How do I copy comment content to cell content as data and not as comment?


--

Dave Peterson
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
how can I place the content of a cel automaticly in a comment willie heijink Excel Discussion (Misc queries) 0 April 27th 07 09:46 AM
Copy row based on cell content billinr New Users to Excel 6 February 21st 07 01:49 PM
Can Comment in a cell be changed as the content in another cell ?? Amit Kumar Baidyaka Excel Discussion (Misc queries) 3 January 10th 07 03:35 AM
How do I copy the cell-content plus its comment to another cell ? Matthias Excel Worksheet Functions 2 March 14th 06 05:41 PM
a comment plugin & copy paste directly from excel to comment ? fr. RFM Excel Worksheet Functions 0 December 1st 04 11:29 PM


All times are GMT +1. The time now is 05:00 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"