Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Extract text from comments

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text from
a cell and put it into a new comment in the adjoining cell - let us say from
column B to column C



Thank you



Camlad


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Extract text from comments

Sub ExtractComment()
Dim cel As Range
For Each cel In Selection
cel.Offset(0, 1).Value = cel.Comment.Text
cel.Comment.Delete
Next cel
End Sub

Sub CreateComment()
Dim cel As Range
For Each cel In Selection
cel.AddComment cel.Offset(0, -1).Value
Next cel
End Sub


HTH
Bob


"camlad" wrote in message
...
First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text
from a cell and put it into a new comment in the adjoining cell - let us
say from column B to column C



Thank you



Camlad


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Extract text from comments

Sub movem()
Set r = Cells.SpecialCells(xlCellTypeComments)
Set r = Intersect(r, Range("B:B"))
For Each rr In r
rr.Offset(0, 1).Value = rr.Comment.Text
Next
End Sub
--
Gary''s Student - gsnu2007L


"camlad" wrote:

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text from
a cell and put it into a new comment in the adjoining cell - let us say from
column B to column C



Thank you



Camlad



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Extract text from comments

Good point Gary's Student:
My code needs the insertion of 'On Error Resume Next' just inside the
For Loop
Your code will be quicker, but is limited by the SpecialCells limit
(about 8900 cells, as I recall)

(My compliments to Gary)

Regards
Bob



"Gary''s Student" wrote in message
...
Sub movem()
Set r = Cells.SpecialCells(xlCellTypeComments)
Set r = Intersect(r, Range("B:B"))
For Each rr In r
rr.Offset(0, 1).Value = rr.Comment.Text
Next
End Sub
--
Gary''s Student - gsnu2007L


"camlad" wrote:

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text
from
a cell and put it into a new comment in the adjoining cell - let us say
from
column B to column C



Thank you



Camlad




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Extract text from comments

Fortunately the OP only has about 500 comments to process.
--
Gary''s Student - gsnu200828


"Bob Alhat" wrote:

Good point Gary's Student:
My code needs the insertion of 'On Error Resume Next' just inside the
For Loop
Your code will be quicker, but is limited by the SpecialCells limit
(about 8900 cells, as I recall)

(My compliments to Gary)

Regards
Bob



"Gary''s Student" wrote in message
...
Sub movem()
Set r = Cells.SpecialCells(xlCellTypeComments)
Set r = Intersect(r, Range("B:B"))
For Each rr In r
rr.Offset(0, 1).Value = rr.Comment.Text
Next
End Sub
--
Gary''s Student - gsnu2007L


"camlad" wrote:

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text
from
a cell and put it into a new comment in the adjoining cell - let us say
from
column B to column C



Thank you



Camlad






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Extract text from comments

Wow! What a prompt response.
Many thanks Bob and Gary"y Student.

Camlad


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Extract text from comments

but is limited by the SpecialCells limit (about 8900 cells, as I recall)

There's not directly a cell qty limit but there's 8192 non-contiguous areas
limit when SpecialCells is used in VBA.

Regards,
Peter T

"Bob Alhat" wrote in message
...
Good point Gary's Student:
My code needs the insertion of 'On Error Resume Next' just inside the
For Loop
Your code will be quicker, but is limited by the SpecialCells limit
(about 8900 cells, as I recall)

(My compliments to Gary)

Regards
Bob



"Gary''s Student" wrote in
message ...
Sub movem()
Set r = Cells.SpecialCells(xlCellTypeComments)
Set r = Intersect(r, Range("B:B"))
For Each rr In r
rr.Offset(0, 1).Value = rr.Comment.Text
Next
End Sub
--
Gary''s Student - gsnu2007L


"camlad" wrote:

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text
from
a cell and put it into a new comment in the adjoining cell - let us say
from
column B to column C



Thank you



Camlad






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Extract text from comments

Thanks Peter,

My recall was clearly not total, or helpful.

Bob

"Peter T" <peter_t@discussions wrote in message
...
but is limited by the SpecialCells limit (about 8900 cells, as I recall)


There's not directly a cell qty limit but there's 8192 non-contiguous
areas limit when SpecialCells is used in VBA.

Regards,
Peter T

"Bob Alhat" wrote in message
...
Good point Gary's Student:
My code needs the insertion of 'On Error Resume Next' just inside the
For Loop
Your code will be quicker, but is limited by the SpecialCells limit
(about 8900 cells, as I recall)

(My compliments to Gary)

Regards
Bob



"Gary''s Student" wrote in
message ...
Sub movem()
Set r = Cells.SpecialCells(xlCellTypeComments)
Set r = Intersect(r, Range("B:B"))
For Each rr In r
rr.Offset(0, 1).Value = rr.Comment.Text
Next
End Sub
--
Gary''s Student - gsnu2007L


"camlad" wrote:

First

I need to extract the text from comments in approximately 500 cells in
column B and place the text into the cells in column C. I am not
talking
about simply moving the comment - he text needs to go from comment to
adjoining cell.



A bonus would be to delete the comment.



Please can you help me with a macro to do this automatically?



Second

Conversely I need a macro to do the reverse - that is to take the text
from
a cell and put it into a new comment in the adjoining cell - let us say
from
column B to column C



Thank you



Camlad







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 Cell Comments and Paste as text in a cell Goaliemenace Excel Worksheet Functions 3 October 19th 09 10:28 PM
Is there a way to extract numbers from comments for use in a formu cadscout Excel Discussion (Misc queries) 1 November 10th 06 05:28 PM
Extract Comments and paste as values Btibert Excel Discussion (Misc queries) 1 September 30th 05 10:02 PM
extract comments HJC Excel Discussion (Misc queries) 7 June 25th 05 04:30 PM
Extract Cell Comments? snoland Excel Programming 3 September 30th 04 01:27 PM


All times are GMT +1. The time now is 10:06 PM.

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"