View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Nicholls Jim Nicholls is offline
external usenet poster
 
Posts: 2
Default Macro to Insert Comment to a cell

I'm assuming that you know how to place a button ont o a worksheets. Here's
the code to put behind it.

Sub vbutton()
Dim strComments As String
strComments = InputBox("Please enter your comments")

ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Environ$("USERNAME") & Chr(10) & "Jimbo"
ActiveCell.Offset(1, 0).Select 'Moves to the cell below the activecell.
If you
'want to move to the cell to the right, use Activecell.Offset(0,1).Select
End Sub

I know it's not quite what your looking for but it might be ok!?

Thanks
James Nicholls





"wojo" wrote:

I have created a file that will be used by many "non computer" types.
I would like to create a macro that will select the current cell,
"Insert Comment", then wait for the user to input the comment. When
the user selects ENTER, The macro would then to to the next cell.

Additionally, I would not like any text in the comment box, when the
user is prompted for the text. I think Excel defaults to the username:

Thanks in advance.

Jo