cell comments

G

Greggo G

here it goes - is it possible to have a comment automatically appear in a
cell if the info entered meets certain criteria?

Greg
 
L

Luke M

Yes. Right click on sheet tab, view code, paste this in. Adjust as necessary.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target Is Nothing Then Exit Sub

'Change this to your criteria
If Target.Value = "Bob" Then
With Target
.AddComment

'Set this to true if you want
'comment visible all the time
.Comment.Visible = False

'Change text to whatever you want comment to be
.Comment.Text Text:="My comment" & CHAR
End With
End If

End Sub
 
G

Greggo G

Thanks Luke - I'll play around and see if I can get it to work (still have a
whole lot to learn about VBA)
 
Top