Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Copy comment to another cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy comment to another cell

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Copy comment to another cell

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
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 content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
How do I copy a comment to become the information in a cell. Patrick from RAS Excel Discussion (Misc queries) 1 August 24th 05 06:45 AM
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 01:58 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"