Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Moving a Comment into a Cell - automaticlly

Hello,

I have a spreadsheet with over 7000 rows. one of the rows, Column E,
periodically has comments attached to it. Can I write a VBA or Macro to
take the comments assigned to the cells in Column E and move them into a new
column as text. I wish to do this since I am exporting the file to text so I
may import it into Access, and I do not want to lose the info in the comment
field.

How to I copy the comment from E1 and place it in text in column F1. Then
automate this process to repeat for all 7000 rows.

Thank you in advance for your help.
Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Moving a Comment into a Cell - automaticlly

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

For Each rr In r
rr.Offset(0, 1).Value = rr.comment.Text
Next
End Sub
--
Gary''s Student - gsnu200745


"Mike P" wrote:

Hello,

I have a spreadsheet with over 7000 rows. one of the rows, Column E,
periodically has comments attached to it. Can I write a VBA or Macro to
take the comments assigned to the cells in Column E and move them into a new
column as text. I wish to do this since I am exporting the file to text so I
may import it into Access, and I do not want to lose the info in the comment
field.

How to I copy the comment from E1 and place it in text in column F1. Then
automate this process to repeat for all 7000 rows.

Thank you in advance for your help.
Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Moving a Comment into a Cell - automaticlly

This worked brilliantly! Thank You.

"Gary''s Student" wrote:

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

For Each rr In r
rr.Offset(0, 1).Value = rr.comment.Text
Next
End Sub
--
Gary''s Student - gsnu200745


"Mike P" wrote:

Hello,

I have a spreadsheet with over 7000 rows. one of the rows, Column E,
periodically has comments attached to it. Can I write a VBA or Macro to
take the comments assigned to the cells in Column E and move them into a new
column as text. I wish to do this since I am exporting the file to text so I
may import it into Access, and I do not want to lose the info in the comment
field.

How to I copy the comment from E1 and place it in text in column F1. Then
automate this process to repeat for all 7000 rows.

Thank you in advance for your help.
Mike

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
Moving comment box leader arrow head Francisco Rodriguez[_2_] Excel Discussion (Misc queries) 0 January 4th 10 08:31 PM
Fix a comment to a moving datum point in a line chart JLS Charts and Charting in Excel 1 November 7th 08 04:10 PM
Stop comment boxes moving to other areas on XLworksheet Tut Excel Discussion (Misc queries) 0 March 16th 07 02:37 AM
Moving, Resizing a Cell Comment Dave Peterson Excel Programming 3 December 7th 06 06:17 AM
Automaticlly Running Macro on Changed Cell Chris Excel Programming 1 December 2nd 03 03:54 PM


All times are GMT +1. The time now is 07:51 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"