I'm new to creating Excel functions, and I need to create a function that takes a range of cells and calculates the sum of the values of cells that are not crossed out.
Function SUMNOTSTRIKE(rng As Range)
Dim cell As Range
For Each cell In rng
If Not (cell.Font.StrikeThrough) Then
SUMNOTSTRIKE = SUMNOTSTRIKE + cell.Value
End If
Next cell
End Function
This function works fine, but I don’t understand why the result is not updated automatically when hit or deleted. I have to execute the function again.
I read something about Application.Volatile, but it only works when the value changes. I need a function that will fire when the format changes.
source
share