Excel VBA質問スレ Part13at TECH
Excel VBA質問スレ Part13 - 暇つぶし2ch690:デフォルトの名無しさん
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, "$")


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch