cell with comments

  • Thread starter Thread starter kiboy^palaboy
  • Start date Start date
K

kiboy^palaboy

how to create a formula to sum all cells in a column that has c comment,is
that possible?
 
You will have to use a UDF. Try the below. If you are new to macros set the
Security level to low/medium in (Tools|Macro|Security). From workbook launch
VBE using short-key Alt+F11. From menu 'Insert' a module and paste the below
code. Save. Get back to Workbook.

To use it in cell; try the below formula
=sumcomment(D9:F13)

Function SumComment(varRange As Range)
SumComment = 0
For Each varCell In varRange
If Not varCell.Comment Is Nothing Then
SumComment = SumComment + varCell
End If
Next
End Function

If this post helps click Yes
 
This function won't recalculate when a comment is added or removed.

It's probably a good idea to make it volatile--and even then, it may be not
return accurate results without forcing a recalculation.
 

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