View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default how do i sum a column ignoring cells strikedthrough

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


"Tracey" wrote in message
...