|
ベタですが。
Option Explicit
Sub test()
Const str = "1=2 3=4 5=AAA 7=8 9=AA BB CC 10=11"
Dim Cpos As Long, Spos As Long, Epos As Long
Dim TextData() As String, Count As Long
Spos = 1
For Cpos = 1 To Len(str)
Select Case Mid(str, Cpos, 1)
Case " "
Epos = Cpos
Case "="
If Epos > Spos Then
Count = Count + 1
ReDim Preserve TextData(1 To Count)
TextData(Count) = Mid(str, Spos, Epos - Spos)
Spos = Epos + 1
End If
End Select
Next Cpos
If Cpos > Spos Then
Count = Count + 1
ReDim Preserve TextData(1 To Count)
TextData(Count) = Mid(str, Spos, Cpos - Spos)
End If
Stop
End Sub
|
|