fill cell comments automatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table which lists: project name, date, value

In a cell on a different worksheet I use an array forumla to add up the
"values" which meet the "date" criteria. I would like to automatically add
comments to this cell which lists the "project names" it has added up
 
Andrew,
Comments are one of the few aspects of the Excel environment you can
manipulate from a UDF:

Public Function CommentTest(argValue As Variant) As String
Dim com As Comment

On Error Resume Next
Set com = Application.Caller.AddComment

If Err.Number > 0 Then Set com = Application.Caller.Comment
On Error GoTo 0

With com
.Text "Comment added by a UDF" & vbNewLine, , False
End With

CommentTest = "Returned Value"

End Function

NickHK
 
Back
Top