I have a cell text "12-3 0000 9 FLY AIR Make MY Trip"
and I want the output like 12-3 0000 9 into next cell and the next sequence cell "FLY AIR Make MY Trip".
Public Function SplitText(pWorkRng As Range, pIsNumber As Boolean) As String
'Updateby20150306
Dim xLen As Long
Dim xStr As String
xLen = VBA.Len(pWorkRng.Value)
For i = 1 To xLen
xStr = VBA.Mid(pWorkRng.Value, i, 1)
If ((VBA.IsNumeric(xStr) And pIsNumber) Or (Not (VBA.IsNumeric(xStr)) And Not (pIsNumber))) Then
SplitText = SplitText + xStr
End If
Next
End Function
=SplitText(A2,FALSE) into a blank cell to get the only the text.
Result as 12300009
=SplitText(A2,TRUE) into a blank cell to get the only the number.
Result as "- FLY AIR Make MY Trip"