I'm trying to make a VBA module to sum cells excluding cells with a strikethrough. The code I'm using below works great, but will not calculate decimals. For instance, '5 + 5.50' will equal 10.00
I want to the code to keep decimals values up to two decimal places so that the sum above would be 10.50
.
Public Function ExcStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
If Not pRng.Font.Strikethrough Then
xOut = xOut + pRng.Value
End If
Next
ExcStrike = xOut
End Function