Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Extract Cell Comments and Paste as text in a cell

Is there an easier function/process to copy cell comments and paste directly
into a cell as text, without having to edit the comment first and select the
required text manually? Copy and paste comments does not work, it merely
keeps the same character when pasted into a new cell.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Extract Cell Comments and Paste as text in a cell

Code by Dave Peterson........posted on Debra Dalgleish's site.

http://www.contextures.on.ca/xlcomme...l#CopyAdjacent

Sub ShowCommentsNextCell()
'based on code posted by Dave Peterson 2003-05-16
Application.ScreenUpdating = False

Dim commrange As Range
Dim mycell As Range
Dim curwks As Worksheet

Set curwks = ActiveSheet

On Error Resume Next
Set commrange = curwks.Cells _
.SpecialCells(xlCellTypeComments)
On Error GoTo 0

If commrange Is Nothing Then
MsgBox "no comments found"
Exit Sub
End If

For Each mycell In commrange
If mycell.Offset(0, 1).Value = "" Then
mycell.Offset(0, 1).Value = mycell.Comment.Text
End If
Next mycell

Application.ScreenUpdating = True

End Sub


Gord Dibben MS Excel MVP

On Fri, 16 Oct 2009 14:03:01 -0700, Goaliemenace
wrote:

Is there an easier function/process to copy cell comments and paste directly
into a cell as text, without having to edit the comment first and select the
required text manually? Copy and paste comments does not work, it merely
keeps the same character when pasted into a new cell.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Extract Cell Comments and Paste as text in a cell

Select the cells in question and run nthis small macro:

Sub comment_setter()
Dim r As Range, rr As Range
On Error Resume Next
Set r = Selection.SpecialCells(xlCellTypeComments)
If r Is Nothing Then
MsgBox ("no comments found")
Exit Sub
End If

For Each rr In r
rr.Value = rr.comment.Text
Next
End Sub
--
Gary''s Student - gsnu200907


"Goaliemenace" wrote:

Is there an easier function/process to copy cell comments and paste directly
into a cell as text, without having to edit the comment first and select the
required text manually? Copy and paste comments does not work, it merely
keeps the same character when pasted into a new cell.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Extract Cell Comments and Paste as text in a cell

Perfect - thank you

"Gary''s Student" wrote:

Select the cells in question and run nthis small macro:

Sub comment_setter()
Dim r As Range, rr As Range
On Error Resume Next
Set r = Selection.SpecialCells(xlCellTypeComments)
If r Is Nothing Then
MsgBox ("no comments found")
Exit Sub
End If

For Each rr In r
rr.Value = rr.comment.Text
Next
End Sub
--
Gary''s Student - gsnu200907


"Goaliemenace" wrote:

Is there an easier function/process to copy cell comments and paste directly
into a cell as text, without having to edit the comment first and select the
required text manually? Copy and paste comments does not work, it merely
keeps the same character when pasted into a new cell.

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
Extract text from cell berniean Excel Worksheet Functions 9 August 19th 09 03:44 AM
how to cut part of a text from one cell and automatically paste itonto another cell Sonja[_2_] Excel Discussion (Misc queries) 6 August 17th 09 11:35 PM
Extract Cell Comments/Notes to data MSpaven75 Excel Discussion (Misc queries) 7 December 11th 08 02:58 PM
Extract Comments and paste as values Btibert Excel Discussion (Misc queries) 1 September 30th 05 10:02 PM
Paste Link - Cell Comments get lost Wayne H Excel Worksheet Functions 2 February 26th 05 11:51 PM


All times are GMT +1. The time now is 09:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"