FatalExceptionError
Technical User
Code:
Public Function CountOccurance(Foo As Variant, Nums As Variant) As Variant
'----------------------------------------------------------------------
'** A function with one required arguments to count the occurences of a string
' and return the total occurences of that string in a range
' Can be called with formulas such as =CountString(F3), =CountString(Support).
'----------------------------------------------------------------------
Dim Count As Double, i As Variant
On Error GoTo Handler
Count = 0
For Each Foo In Nums
If Nums = Foo Then
Count = Count + 1
Next
CountOccurance = Count
Exit Function
Handler:
Add3 = CVErr(2036) 'xlErrNum = 2036
End Function
I need that if statement so I can count the occurance of of something in a range of cells in excel. If cats always land on their feet
and Toast always lands buttered side up
What happens if you tape toast, buttered side up on a cat's back??????