PC Review


Reply
Thread Tools Rate Thread

Copy Cell to Comment

 
 
Gary''s Student
Guest
Posts: n/a
 
      5th Jan 2009
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 With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      5th Jan 2009
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" <(E-Mail Removed)> wrote in message
news:5E7CF4A0-F823-4E1A-8CBA-(E-Mail Removed)...
>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 With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      5th Jan 2009
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" <(E-Mail Removed)> wrote in message
> news:5E7CF4A0-F823-4E1A-8CBA-(E-Mail Removed)...
> >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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy cell to another as a comment rpick60 Microsoft Excel Worksheet Functions 3 27th Dec 2007 01:56 AM
Copy comment to another cell =?Utf-8?B?SlQ=?= Microsoft Excel Programming 2 25th Jun 2007 05:19 PM
copy comment content to cell content as data not as comment =?Utf-8?B?TGlsYWNo?= Microsoft Excel Misc 2 21st Jun 2007 12:28 PM
How do I copy the cell-content plus its comment to another cell ? =?Utf-8?B?TWF0dGhpYXM=?= Microsoft Excel Worksheet Functions 2 14th Mar 2006 05:41 PM
Copy a comment to another cell - How? Dennis Macdonald Microsoft Excel Programming 2 30th Jul 2003 04:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 AM.