how do i sum a column ignoring cells strikedthrough

B

Bernie Deitrick

Tracey,

With a UDF in VBA:

Function SUMstrike(inR As Range) As Double
Dim myC As Range
For Each myC In inR
If Not myC.Font.Strikethrough Then
SUMstrike = SUMstrike + myC.Value
End If
Next myC
End Function

used like

=SUMstrike(A2:A100)

Note that changing the font of a cell to strikethrough does not fire a calculation, so you will need
to change something else (renenter a number in the range) or do a manual re-calc.

HTH,
Bernie
MS Excel MVP
 

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