PC Review


Reply
Thread Tools Rate Thread

Copy comment to another cell

 
 
=?Utf-8?B?SlQ=?=
Guest
Posts: n/a
 
      25th Jun 2007
On the "Data List" worksheet, the user right-clicks on any column on the row
that contains the data they want to process.

My code picks up several pieces of information and writes it on the
"Worksheet" worksheet.

So far, so good.....However......

Column K on the "Data List" worksheet may or may not contain a comment for
the specific item.

If a comment exists, I would like to: (1) Add the commet to cell (K9) on the
"Worksheet" worksheet and (2) Add "Yes" to cell (K9) on the "Worksheet"
worksheet also.

If there is no comment then I would like to add "No" to cell(K9) on the
"Worksheet" worksheet.

I've seen code that will copy all of the comments on one sheet to another
and have tried to modify that to do what I want but I'm having trouble with
that. Any suggestions or code to accomplish this would be greatly
appreciated.

Thanks for the help.....
--
JT
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      25th Jun 2007
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Count > 1 Then Exit Sub
Dim cell As Range, Cell1 As Range
Dim cmt As Comment
Set Cell1 = Worksheets("Worksheet").Range("K9")
Set cell = Worksheets("Data List").Cells(Target.Row, "K")
If cell.Comment Is Nothing Then
Cell1.Value = "No"
If Not Cell1.Comment Is Nothing Then
Cell1.Comment.Delete
End If
Else
Cell1.Value = "Yes"
If Cell1.Comment Is Nothing Then
Set cmt = Cell1.AddComment
cmt.Text Text:=cell.Comment.Text
Else

Cell1.Comment.Text Text:=cell.Comment.Text
End If
End If
Cancel = True
End Sub

--
Regards,
Tom Ogilvy


"JT" wrote:

> On the "Data List" worksheet, the user right-clicks on any column on the row
> that contains the data they want to process.
>
> My code picks up several pieces of information and writes it on the
> "Worksheet" worksheet.
>
> So far, so good.....However......
>
> Column K on the "Data List" worksheet may or may not contain a comment for
> the specific item.
>
> If a comment exists, I would like to: (1) Add the commet to cell (K9) on the
> "Worksheet" worksheet and (2) Add "Yes" to cell (K9) on the "Worksheet"
> worksheet also.
>
> If there is no comment then I would like to add "No" to cell(K9) on the
> "Worksheet" worksheet.
>
> I've seen code that will copy all of the comments on one sheet to another
> and have tried to modify that to do what I want but I'm having trouble with
> that. Any suggestions or code to accomplish this would be greatly
> appreciated.
>
> Thanks for the help.....
> --
> JT

 
Reply With Quote
 
=?Utf-8?B?SlQ=?=
Guest
Posts: n/a
 
      25th Jun 2007
Tom........Thanks for the help........
--
JT


"Tom Ogilvy" wrote:

> Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
> Boolean)
> If Target.Count > 1 Then Exit Sub
> Dim cell As Range, Cell1 As Range
> Dim cmt As Comment
> Set Cell1 = Worksheets("Worksheet").Range("K9")
> Set cell = Worksheets("Data List").Cells(Target.Row, "K")
> If cell.Comment Is Nothing Then
> Cell1.Value = "No"
> If Not Cell1.Comment Is Nothing Then
> Cell1.Comment.Delete
> End If
> Else
> Cell1.Value = "Yes"
> If Cell1.Comment Is Nothing Then
> Set cmt = Cell1.AddComment
> cmt.Text Text:=cell.Comment.Text
> Else
>
> Cell1.Comment.Text Text:=cell.Comment.Text
> End If
> End If
> Cancel = True
> End Sub
>
> --
> Regards,
> Tom Ogilvy
>
>
> "JT" wrote:
>
> > On the "Data List" worksheet, the user right-clicks on any column on the row
> > that contains the data they want to process.
> >
> > My code picks up several pieces of information and writes it on the
> > "Worksheet" worksheet.
> >
> > So far, so good.....However......
> >
> > Column K on the "Data List" worksheet may or may not contain a comment for
> > the specific item.
> >
> > If a comment exists, I would like to: (1) Add the commet to cell (K9) on the
> > "Worksheet" worksheet and (2) Add "Yes" to cell (K9) on the "Worksheet"
> > worksheet also.
> >
> > If there is no comment then I would like to add "No" to cell(K9) on the
> > "Worksheet" worksheet.
> >
> > I've seen code that will copy all of the comments on one sheet to another
> > and have tried to modify that to do what I want but I'm having trouble with
> > that. Any suggestions or code to accomplish this would be greatly
> > appreciated.
> >
> > Thanks for the help.....
> > --
> > JT

 
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 Comment Gary''s Student Microsoft Excel Programming 2 5th Jan 2009 03:31 PM
Copy cell to another as a comment rpick60 Microsoft Excel Worksheet Functions 3 27th Dec 2007 01:56 AM
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 07:59 AM.