Public Function CountOccurrences(sSource As String, sFind As String) As Integer 'Counts the occurrences of sFind in sSource 'Requires Option Base 0 Dim sTmp() As String sTmp = Split(Replace(sSource, " ", " "), sFind) CountOccurrences = UBound(sTmp) End Function '************** Public Function CountOccurrences(sSource As String, sFind As String) As Integer 'Counts the occurrences of sFind in sSource Dim iCountBefore As Integer Dim iCountAfter As Integer iCountBefore = Len(sSource) sSource = Replace(sSource, sFind, "") iCountAfter = Len(sSource) If Len(sFind) = 1 Then CountOccurrences = iCountBefore - iCountAfter Else CountOccurrences = (iCountBefore - iCountAfter) / Len(sFind) End If End Function '************** Public Function CountOccurrences(sSource As String, sFind As String) As Integer 'Counts the occurrences of sFind in sSource CountOccurrences = (Len(sSource) - Len(Replace(sSource, sFind,""))) / Len(sFind) End Function '************** Public Function CountOccurrences(sSource As String, sFind As String) As Integer 'Counts the occurrences of sFind in sSource 'Requires Option Base 0 Dim iPos As Integer Dim iCtr As Integer iPos = InStr(1, sSource, sFind) Do While iPos > 0 iCtr = iCtr + 1 iPos = InStr(iPos + 1, sSource, sFind) Loop CountOccurrences = iCtr End Function