View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
saman110 via OfficeKB.com saman110 via OfficeKB.com is offline
external usenet poster
 
Posts: 80
Default Clear Comment problem

hello,

I want to get the code below to stop inserting comment when I hit cancel. Any
help?

Thx.

Sub vbutton()
Dim strComments As String
strComments = InputBox("Please Type your comment")

ActiveCell.AddComment
ActiveCell.Comment.Visible = False
ActiveCell.Comment.Text Environ$("USERNAME") & Chr(10) & strComments
If Cancel = True Then
ActiveCell.ClearComments
End If
End Sub

--
Message posted via http://www.officekb.com