PC Review


Reply
Thread Tools Rate Thread

comment copy&past!

 
 
riccifs@tin.it
Guest
Posts: n/a
 
      9th Jan 2008
Hi to everyone,

I'm using this code to copy the text of active cell and paste it to
active cell comment.
I found it at this link:
http://groups.google.com/group/micro...dd1b96d834965e

It works very well but what I'd like to do is that:
a pop up form where I can chose to copy and past the cell content in
its comment but leaving than the cell empty.
The second choice of this pop up have to give to me the possibility to
disable the macro and to use the cell like another.

Hear is the code:

Private Sub Worksheet_Change(ByVal Target As Range)
'Target is a reference to the range that was changed
Const cCheckRange = "A1:J10" 'define range in which this is active
Dim rngR As Range
Dim strExistingText As String, strNewText As String
For Each rngR In Target 'Target may have more than one cell
'is it part of the desired range?
If Range(cCheckRange).Address = Union(Range(cCheckRange),
rngR).Address Then
With rngR
strNewText = Format(Now, "dd/mm/yyyy hh:mm AM/PM") &
Chr(10) & .Value
On Error Resume Next
strExistingText = .Comment.Text 'triggers error if no
comment
On Error GoTo 0
If strExistingText = "" Then
'no existing comment, so add new
.AddComment strNewText
Else
'is existing comment
.Comment.Text strExistingText & Chr(10) & strNewText
End If
'sort out comment size - cannot do directly, so longwinded
way
.Comment.Visible = True
.Comment.Shape.Select
Selection.AutoSize = True
.Comment.Visible = False
End With
End If
Next rngR
End Sub

Many thanks to everyone want help me!
Bye, Stefano.
 
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 comment content to cell content as data not as comment =?Utf-8?B?TGlsYWNo?= Microsoft Excel Misc 2 21st Jun 2007 12:28 PM
Copy and Past =?Utf-8?B?Sm9l?= Microsoft Excel Misc 1 17th Aug 2006 02:10 AM
a comment plugin & copy paste directly from excel to comment ? fr. =?Utf-8?B?UkZN?= Microsoft Excel Worksheet Functions 0 1st Dec 2004 11:29 PM
Re: Copy and past Bonnie Windows XP New Users 1 5th Sep 2003 01:06 PM
Re: Copy and past HillBillyBuddhist Windows XP New Users 0 5th Sep 2003 01:44 AM


Features
 

Advertising
 

Newsgroups
 


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