Worksheet event code is stored on a worksheet module. To add it to your worksheet, do the following:
Copy the code
Select the worksheet in which you the code to run
Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
Where the cursor is flashing, choose Edit | Paste
Here is the code.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 1 Then Exit Sub
If Target = "6111" Then
With Target
.ClearComments
.AddComment
.Comment.Visible = False
.Comment.Text Text:="What the HECK!!"
.Comment.Shape.TextFrame.AutoSize = True
End With
Else: Target.ClearComments
End If
End Sub
Bookmarks