Macro to copy cell contents to comment

R

RichUE

I have a number of cells where I would like to copy the cell contents to a
(new) comment. I recorded a macro to do this, but it includes the specific
cell position. How can I refer to the current cell position?

Sub Cell_text_to_comment()
'
' Cell_text_to_comment Macro
' Copy cell text to comment Macro recorded 03/03/2009
'
' Keyboard Shortcut: Ctrl+Shift+C
'
Range("J83").AddComment
Range("J83").Comment.Visible = False
Range("J83").Comment.Text Text:="R Curtis:" & Chr(10) & "Diode BAV10"
Range("J83").Select
End Sub

I'm not a programmer, so please keep things simple.
 
G

Gary''s Student

Let's use the active cell. This will copy its contents into a comment:

Sub Cell_text_to_comment()
With ActiveCell
.AddComment
.Comment.Visible = False
.Comment.Text Text:=.Value
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top