I am trying to just count errors in a defind range on my spreadsheet. I tried using an array formula but it killed the processing time. I then tried a UDF, shown below, but it also kills the processing time because it runs more than once when doing a standard calculation. Is there a way to set the formula to only run at the end of a calc cycle?
Function CountErrors()
Dim rng, c As Range, e As Integer
Set rng = ActiveSheet.UsedRange
For Each c In rng
If InStr(1, c.Formula, "#REF!") Or IsError(c) Then
CountErrors = CountErrors + 1
End If
Next c
End Function
Thanks!
Bookmarks