here's another try:
cells with values 0 should now get a comment with the cell value
cells with values that have existing comments, should get the cell value
added to the end of the existing comment
cells that are blank or equate to 0 should not get comments.
let me know
Sub FormulaResultToComment()
'Joel .prog
Dim cell As Range
Dim cmt As String
For Each cell In Selection
If cell.Value = 0 Or Len(cell.Address) = 0 Then
'do nothing
ElseIf Not cell.Comment Is Nothing Then
cmt = cell.Comment.Text
cmt = cell.Comment.Text & Chr(10) & cell.Value
cell.Comment.Delete
cell.AddComment cmt
Else
cmt = cell.Value
cell.AddComment cmt
End If
Next cell
End Sub
--
Gary
"Max" wrote in message
...
i don't see any criteria to add comments to any other cells.
please list all of your criteria.
The missing part is the retention of the core functionality of the
original sub, which was to write cell values to comments. I sought the 2
modifications to the original sub, but its core functionality should be
retained. This seemed lost along the way.
Using your latest revision, when I run the sub on a range w/o any existing
comments but with formulas returning values other than null strings,
nothing happens. Thanks.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---