View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Can Excel create a conditional Comment on a cell?

Only through the use of a Macro if you're thinking of a comment type popup.
That could be done with code similar to this using the Worksheet_Change()
event handler (assumes you are watching for values .gt. 150 in cell B5 on a
sheet) :

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address < Range("B5").Address Then
Exit Sub
End If
If Target 150 Then
Target.ClearComments ' erase any old
Target.AddComment
Target.Comment.Visible = False
Target.Comment.Text Text:="The value is above 150"
Else
Target.ClearComments
End If

End Sub

Now, if you just want a visible flag to indicate when a value goes
above/below or reaches a specific value, then you could look into Conditional
Formatting. You can use that [via Format | Conditional Formatting in the
menu toolbar] to set the appearance of a cell based on the value of the cell
itself. This might be a better solution for you since it involves no coding,
is easier to apply to a large number of cells, especially if those cells are
spread out around the worksheet.

"Desmond" wrote:

Can Excel create a conditional Comment on a cell? i.e. if cell value is above
a value, create a comment ("Value is Very High = 'Cell Value' ")