Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comments with text from cells

I am using the below code to create comments. Does anyone know if it can
be modified so that the comments contain text from a given cell?

ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = True

With ActiveCell.Comment.Shape.OLEFormat.Object
.Font.Name = "Arial"
.Font.Size = 20
.Font.Bold = True
.Width = 400
.Height = 300

End With



End Sub


coco



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Comments with text from cells


ActiveCell.Comment.Text Text:= Range("A1").Text

Or

ActiveCell.Comment.Text Text:= Cells(1,1).Text






"coco" skrev i meddelandet
...
I am using the below code to create comments. Does anyone know if it can
be modified so that the comments contain text from a given cell?

ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = True

With ActiveCell.Comment.Shape.OLEFormat.Object
Font.Name = "Arial"
Font.Size = 20
Font.Bold = True
Width = 400
Height = 300

End With



End Sub


coco



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Comments with text from cells

One way:

With ActiveCell.AddComment( _
Text:=Worksheets("Sheet1").Range("A1").Text)
With .Shape
With .TextFrame.Characters.Font
.Name = "Arial"
.Size = 20
.Bold = True
End With
.Width = 400
.Height = 300
End With
.Visible = True
End With

Adjust your sheet and range reference to suit.

In article ,
coco wrote:

I am using the below code to create comments. Does anyone know if it can
be modified so that the comments contain text from a given cell?

ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = True

With ActiveCell.Comment.Shape.OLEFormat.Object
.Font.Name = "Arial"
.Font.Size = 20
.Font.Bold = True
.Width = 400
.Height = 300

End With



End Sub


coco

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comments with text from cells

Fantastic!

Both work solutions work perfectly.


Thanks for your help guys.



coco :D



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Comments with text from cells

Cell Comments
http://www.mvps.org/dmcritchie/excel/ccomment.htm

Function to obtain cell comments from another cell (#mycomment)
http://www.mvps.org/dmcritchie/excel....htm#mycomment

Macro to populate comments in a range with text values of another range (#addcomments)
http://www.mvps.org/dmcritchie/excel...tm#addcomments

Sub CommentPopulateSelection()
Dim cell As Range
Selection.ClearComments
If Trim(ActiveCell.Text) < "" Then
For Each cell In Selection
cell.AddComment ActiveCell.Text
Next cell
End If
End Sub

or from a specific cell
cell.AddComment range("B4").Text

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"coco" wrote in message ...
I am using the below code to create comments. Does anyone know if it can
be modified so that the comments contain text from a given cell?

ActiveCell.AddComment
ActiveCell.Comment.Text Text:=""
ActiveCell.Comment.Visible = True

With ActiveCell.Comment.Shape.OLEFormat.Object
Font.Name = "Arial"
Font.Size = 20
Font.Bold = True
Width = 400
Height = 300

End With



End Sub


coco



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





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
building comments from text cells Michael.Tarnowski Excel Worksheet Functions 20 February 10th 09 10:50 AM
Text Box Comments TashaTart Excel Discussion (Misc queries) 0 May 3rd 06 04:17 PM
how can we copy cells comments text and paste to cells שי פלד Excel Discussion (Misc queries) 3 December 12th 05 05:16 AM
Text disappearing from cells and comments? tlkcpa Excel Discussion (Misc queries) 1 December 7th 05 07:13 AM
Add Comments with Text From Cells coco Excel Programming 1 October 4th 03 08:10 PM


All times are GMT +1. The time now is 07:22 AM.

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

About Us

"It's about Microsoft Excel"