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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top