Macro for Comment


Posted by Pinga on November 03, 2001 6:24 PM

I need a macro to copy the Text from a cell into a comment. Can someone help me?

Posted by Barrie Davidson on November 03, 2001 6:42 PM

The following macro will copy the text from the active cell into a comment for the active cell.

Sub AddComment()
' Written by Barrie Davidson
ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Text:=ActiveCell.Value
End Sub


Regards,
BarrieBarrie Davidson

Posted by Pinga on November 04, 2001 9:55 AM

Re: Thanks, but it does not work.

This is what I want the macro to do; J16 thru J61 to create a comments base on the text value of H76.

Thanks



Posted by Barrie Davidson on November 05, 2001 5:35 AM

Re: Thanks, but it does not work.

Thanks

Okay, try this instead.

Sub AddComment()
' Written by Barrie Davidson
For Each cell In Range("J16:J61")
cell.AddComment (Range("H76").Value)
Next cell
End Sub


Regards,
BarrieBarrie Davidson