Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Copy Cell to Comment

I have some cells formatted as Text. I need to insert a comment in these
cells and copy the value in the cell to the comment. I need the formatting
in the cell to be copied along with the text. So, for example, if the text
in the cell is bold, then the text in the comment should also be bold, etc.
I am now using:

Sub SetComment()
With Selection
.AddComment
.Comment.Visible = True
.Comment.Text Text:=.Value
End With
End Sub

This creates the comment and copies the text, but it does not copy the
formatting.

How do I get the formatting to copy in addition to the value?

--
Gary''s Student - gsnu200823
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Copy Cell to Comment

Sub SetComment2()
Dim cel As Range
Dim cm As Comment
Set cel = ActiveCell
With cel
cel.ClearComments
Set cm = .AddComment
cm.Text Text:=.Value
End With
cm.Visible = True
With cm.Shape.TextFrame.Characters.Font
.Bold = cel.Font.Bold
' etc
End With
End Sub

Regards,
Peter T

"Gary''s Student" wrote in message
...
I have some cells formatted as Text. I need to insert a comment in these
cells and copy the value in the cell to the comment. I need the
formatting
in the cell to be copied along with the text. So, for example, if the
text
in the cell is bold, then the text in the comment should also be bold,
etc.
I am now using:

Sub SetComment()
With Selection
.AddComment
.Comment.Visible = True
.Comment.Text Text:=.Value
End With
End Sub

This creates the comment and copies the text, but it does not copy the
formatting.

How do I get the formatting to copy in addition to the value?

--
Gary''s Student - gsnu200823



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Copy Cell to Comment

Thank you!
--
Gary''s Student - gsnu200823


"Peter T" wrote:

Sub SetComment2()
Dim cel As Range
Dim cm As Comment
Set cel = ActiveCell
With cel
cel.ClearComments
Set cm = .AddComment
cm.Text Text:=.Value
End With
cm.Visible = True
With cm.Shape.TextFrame.Characters.Font
.Bold = cel.Font.Bold
' etc
End With
End Sub

Regards,
Peter T

"Gary''s Student" wrote in message
...
I have some cells formatted as Text. I need to insert a comment in these
cells and copy the value in the cell to the comment. I need the
formatting
in the cell to be copied along with the text. So, for example, if the
text
in the cell is bold, then the text in the comment should also be bold,
etc.
I am now using:

Sub SetComment()
With Selection
.AddComment
.Comment.Visible = True
.Comment.Text Text:=.Value
End With
End Sub

This creates the comment and copies the text, but it does not copy the
formatting.

How do I get the formatting to copy in addition to the value?

--
Gary''s Student - gsnu200823




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 do i copy information from a cell into a comment? MandiMae Excel Discussion (Misc queries) 2 April 23rd 08 09:09 PM
Copy cell to another as a comment rpick60 Excel Worksheet Functions 3 December 27th 07 01:56 AM
Copy comment to another cell JT Excel Programming 2 June 25th 07 05:19 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
Copy a comment to another cell - How? Dennis Macdonald Excel Programming 2 July 30th 03 04:24 AM


All times are GMT +1. The time now is 12:50 PM.

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"