Yet another way...
VB Code:
Private Sub Form_Load() Dim strtext As String, strSearch As String strtext = UCase("These are my word examples. My word on it.") strSearch = UCase("word") Debug.Print "Times WORD in string = "; (Len(strtext) - Len(Replace(strtext, strSearch, ""))) / Len(strSearch) End Sub




Reply With Quote