Function CountNums(S As String, Typ As String) As Long
Dim Pattern As String, V As Variant
If Typ = "" Then Exit Function
Pattern = Choose(1 + (4 + InStr("/EVEN/ODD/", UCase("/" & Typ & "/"))) \ 5, "|", "*[02468]", "*[13579]")
For Each V In Split(Replace(S, " ", ""), ",")
CountNums = CountNums - (V Like Pattern)
Next
End Function