View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default XL2003: Move a Comment Into a Different Cell?

You could use a macro...

Option Explicit
Sub testme()

Dim FromCell As Range
Dim ToCell As Range

Set FromCell = Nothing
On Error Resume Next
Set FromCell = Application.InputBox _
(Prompt:="Select the From Cell", _
Default:=ActiveCell.Address, _
Type:=8).Cells(1)
On Error GoTo 0

If FromCell Is Nothing Then
Exit Sub 'user hit cancel
End If

If FromCell.Comment Is Nothing Then
MsgBox "No comment in that cell!"
Exit Sub
End If

Set ToCell = Nothing
On Error Resume Next
Set ToCell = Application.InputBox _
(Prompt:="Select the To Cell", _
Type:=8).Cells(1)
On Error GoTo 0

If ToCell Is Nothing Then
Exit Sub
End If

FromCell.Copy
ToCell.PasteSpecial Paste:=xlPasteComments

FromCell.Comment.Delete

Application.CutCopyMode = False

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Daddy wrote:

Is it possible to move a comment into a different cell?

For example: I have a comment in cell B4; can I move it to cell A4?

I realize that I could always copy the comment to the new cell and then
delete the comment in the old cell, but surely there's an easier way?
Copy-and-delete becomes tedious when you have to do it for dozens of cells
individually.

Daddy


--

Dave Peterson