09/11/21 00:40:26
>>687
VBAのSplitが正規表現を受付けないんじゃないの
s = "123 456 789"
ArySize = 0
Dim Ary()
Set re = CreateObject("VBScript.RegExp")
re.Pattern = "[ ,]+"
Do
ArySize = ArySize + 1
ReDim Preserve Ary(ArySize)
Set Matches = re.Execute(s)
If Matches.Count <> 0 Then
v = Left(s, Matches(0).FirstIndex)
s = Right(s, Len(s) - (Matches(0).FirstIndex + Matches(0).Length))
Else
v = s
End If
Ary(ArySize - 1) = v
MsgBox v
Loop While Matches.Count <> 0
MsgBox Join(Ary, "$")