Private Sub btnTestParseString_Click()
On Error GoTo Err_btnTestParseString_Click
Dim strIn As String
Dim lMaxStep As Long
Dim lStep As Long
Dim strThisChar As String
Dim strFindChar As String
Dim lFstFoundChar As Long
Dim strThisWord As String
strIn = "1 Day I went to see 5 elephants at the zoo. It was 2.5 miles away from my 4 bedroom house"
lMaxStep = Len(strIn)
strFindChar = Chr(32)
lFstFoundChar = 1
If lMaxStep > 0 Then
For lStep = 1 To lMaxStep
strThisChar = Mid(strIn, lStep, 1)
If strThisChar = strFindChar Then
strThisWord = Mid(strIn, lFstFoundChar, lStep - lFstFoundChar)
Debug.Print ">" & strThisWord & "<"
If IsNumeric(strThisWord) = True Then
Debug.Print "Is numeric, so do something..."
End If
lFstFoundChar = lStep + 1
End If
Next lStep
End If
Exit_btnTestParseString_Click:
Exit Sub
Err_btnTestParseString_Click:
Call errorhandler_MsgBox("Form: Form_TestCollection, Subroutine: btnTestParseString_Click()")
Resume Exit_btnTestParseString_Click
End Sub