¼Ä¼þÕߣºJ.E. McGimpsey (
[email protected])
Ö÷Ö¼£ºRe: How do I copy comment data to new cell?
View: Complete Thread £¨¹²ÓÐ 2 ÌõÁôÑÔ£©
Original Format
ÍøÉÏÂÛ̳£ºmicrosoft.public.word.formatting.longdocs,
microsoft.public.excel.programming
ÈÕÆÚ£º2002-11-11 21:26:03 PST
This should really have been posted in the
microsoft.public.excel.programming newsgroup, rather than a Word group.
I'm cross-posting my reply with follow-up set to that group.
Here's one way:
Public Sub CopyCommentsToNextColumn()
Const MYCOL As Integer = 1 'Column A
Dim cell As Range
For Each cell In Range(Cells(1, MYCOL), _
Cells(Rows.Count, MYCOL).End(xlUp))
With cell
If Not .Comment Is Nothing Then
.Offset(0, 1).Value = .Comment.Text
.Comment.Delete
End If
End With
Next cell
End Sub
This will copy any comment to the adjacent cell, and will delete the
comment. If you want to leave the comments in place, comment out or
remove the .Comment.Delete line. Change your MYCOL column number to
suit.