ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Need to sum values that are not strikethroughs (https://www.excelbanter.com/new-users-excel/86524-need-sum-values-not-strikethroughs.html)

Rock

Need to sum values that are not strikethroughs
 
I need to sum a column without it adding the rows that have strikethroughs
values; is it possible to combine a formula and vb code to a cell ?

=SUM(BH100:BH120) & Activecell.selection.font.strikethrough = false

Thank you
Khf

Gary''s Student

Need to sum values that are not strikethroughs
 
Try:


Function zum(r As Range) As Double
Dim rr As Range
For Each rr In r
If rr.Font.Strikethrough = False Then
zum = zum + rr.Value
End If
Next
End Function


In the worksheet use it like:

=zum(A1:A10)
--
Gary''s Student


"Rock" wrote:

I need to sum a column without it adding the rows that have strikethroughs
values; is it possible to combine a formula and vb code to a cell ?

=SUM(BH100:BH120) & Activecell.selection.font.strikethrough = false

Thank you
Khf



All times are GMT +1. The time now is 12:30 PM.

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