Activating a comment box based on conditional formatting

  • Thread starter Andrew Rodriguez
  • Start date
A

Andrew Rodriguez

Hi there, assistance is appreciated. I am trying to set a cell to show a
pre-added comment box based on a conditional formatting (i.e. if cell value
is less than 0, make background red AND show comment.

Thanks,
 
J

Jim May

Do you mean something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
If Not Application.Intersect(Target, Range("A1")) Is Nothing And
Target.Value < 0 Then
Target.AddComment Text:="Amount is in the Negative"
Target.Comment.Visible = True
End If
End Sub
 
A

Andrew Rodriguez

Hi Jim,
Thanks for your response, it is appreciated. I recognize that it must be
added to the worsheet in VBA mode but how do I activate it?...also I wish
this to work on multiple cells and not all cells are in a continuous column,
though all are in the same column. Sorry, I am not familiar in any way with
the VBA part of Excel though I recognize the code from macro creation.
 
Top