Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Const TestStr = "abc12345"
Sub Main()
Parse_Chars (TestStr)
End Sub
Sub Parse_Chars(ByVal InptStr As String)
Dim NoAlpha As Boolean
Dim AlphaStr As String
Dim OneChar As String * 1
Dim NumStr As String
Dim i As Integer
AlphaStr = ""
NumStr = ""
NoAlpha = False
Do
For i = 1 To Len(InptStr)
OneChar = Mid$(InptStr, i, 1)
If OneChar Like "[A-Z,a-z]" Then
AlphaStr = AlphaStr & OneChar
Else
NumStr = Mid$(InptStr, i)
NoAlpha = True
Exit For
End If
Next i
Loop Until NoAlpha
Debug.Print AlphaStr
Debug.Print NumStr
End Sub
Sub Main()
Dim c As Range
Dim Alpha As String
Dim Num As String
For Each c In Range("A1:A20")
Parse_Chars c.Text, Alpha, Num
c.Offset(0,1).Value = Alpha
c.Offset(0,2).Value = Num
Next c
End Sub
Sub Parse_Chars(byVal InptStr As String, byRef AlphaStr As String, byRef NumStr As String)
Dim NoAlpha As Boolean
Dim OneChar As String * 1
Dim i As Integer
AlphaStr = ""
NumStr = ""
NoAlpha = False
Do
For i = 1 To Len(InptStr)
OneChar = Mid$(InptStr, i, 1)
If OneChar Like "[A-Z,a-z]" Then
AlphaStr = AlphaStr & OneChar
Else
NumStr = Mid$(InptStr, i)
NoAlpha = True
Exit For
End If
Next i
Loop Until NoAlpha
End Sub