ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   cell with comments (https://www.excelbanter.com/excel-discussion-misc-queries/234951-cell-comments.html)

kiboy^palaboy[_2_]

cell with comments
 
how to create a formula to sum all cells in a column that has c comment,is
that possible?

Jacob Skaria

cell with comments
 
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
---------------
Jacob Skaria


"kiboy^palaboy" wrote:

how to create a formula to sum all cells in a column that has c comment,is
that possible?


Dave Peterson

cell with comments
 
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.



Jacob Skaria wrote:

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
---------------
Jacob Skaria

"kiboy^palaboy" wrote:

how to create a formula to sum all cells in a column that has c comment,is
that possible?


--

Dave Peterson

Jacob Skaria

cell with comments
 
Thanks Dave, I missed to mention that..
--
If this post helps click Yes
---------------
Jacob Skaria


"Dave Peterson" wrote:

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.



Jacob Skaria wrote:

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
---------------
Jacob Skaria

"kiboy^palaboy" wrote:

how to create a formula to sum all cells in a column that has c comment,is
that possible?


--

Dave Peterson



All times are GMT +1. The time now is 04:01 PM.

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