Code:
Function CountOccurences(sInputstring As String, sSearchstring As String) As Long
'0:48:14 - saturday 10.02.2007 - Vijay Saraff
'Counts the number of occurences of a particular string pattern in an input string
'works by splitting on string pattern and counting the # of splits
'dont know if this is the fastest/most efficient way of doing this
CountOccurences = UBound(Split(sInputstring, sSearchstring))
End Function