ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   fill cell comments automatically (https://www.excelbanter.com/excel-programming/390685-fill-cell-comments-automatically.html)

Andrew

fill cell comments automatically
 
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


--
Thanks
Andrew

NickHK

fill cell comments automatically
 
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

"Andrew" wrote in message
...
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


--
Thanks
Andrew





All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com