Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macro to copy cell contents to comment

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.

--
Richard

Search the web and raise money for charity at www.everyclick.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro to copy cell contents to comment

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


--
Gary''s Student - gsnu200835


"RichUE" wrote:

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.

--
Richard

Search the web and raise money for charity at www.everyclick.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macro to copy cell contents to comment

That's just what I need. Thanks!
--
Richard

Search the web and raise money for charity at www.everyclick.com


"Gary''s Student" wrote:

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


--
Gary''s Student - gsnu200835


"RichUE" wrote:

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.

--
Richard

Search the web and raise money for charity at www.everyclick.com

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
lookup cell reference and copy contents and comment from a range GarySW Excel Worksheet Functions 0 May 28th 09 06:14 PM
Macro to Copy and Paste Cell Contents Thorson Excel Programming 2 January 21st 09 09:20 PM
Macro - copy cell contents IF Scott Wagner Excel Programming 4 February 17th 06 09:48 PM
Macro to copy cell contents number of columns Pierre Excel Programming 10 November 4th 04 10:54 PM
Copy cell contents into Macro code Bob Leonard Excel Programming 2 December 1st 03 07:29 PM


All times are GMT +1. The time now is 03:13 AM.

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"