Public Sub LMSplit(Letter() As String, Number() As String)
Dim i As Long
Dim j As Long
Dim k As Long
Dim myData As String
Dim xx As String
Dim LetBuf As String
Dim NumBuf As String
Dim bNum As Boolean
myData = Range("A1").Value
For i = 1 To Len(myData)
xx = Mid(myData, i, 1)
If xx Like "[0-9]" Then
If Not bNum And i > 1 Then
Letter(k) = LetBuf
LetBuf = ""
k = k + 1
End If
NumBuf = NumBuf & xx
bNum = True
Else
If bNum Then
Number(j) = NumBuf
NumBuf = ""
j = j + 1
End If
LetBuf = LetBuf & xx
bNum = False
End If
Next i
If LetBuf <> "" Then
Letter(k) = LetBuf
End If
If NumBuf <> "" Then
Number(j) = NumBuf
End If
End Sub
|