Need to sum values that are not strikethroughs

R

Rock

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
 
G

Gary''s Student

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)
 

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

Top