PDA

View Full Version : If the selected cell does not have a comment, then insert a comment.



uktous
07-30-2012, 07:37 AM
Hi,

Could you please write me the macro that can perform the following function?

If the selected cell does not have a comment, then insert a comment.

Thanks

Simon Lloyd
07-30-2012, 10:09 PM
As requestedPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cmnt As String
If Target.Comment Is Nothing Then
With Target
cmnt = Application.InputBox("Enter Comment", "Comment Entry")
.AddComment
.Comment.Text Text:=cmnt
End With
End If
End Sub