LBound関数…引数に指定した配列の、最も小さい要素番号を返す
UBound関数…引数に指定した配列の、最も大きい要素番号を返す
この関数をうまく使う
Sub Sample2() Dim tmp As Variant, i As Long tmp = Split("123,田中,tanaka", ",") For i = LBound(tmp) To UBound(tmp) MsgBox tmp(i) Next i End Sub
LBound関数…引数に指定した配列の、最も小さい要素番号を返す
UBound関数…引数に指定した配列の、最も大きい要素番号を返す
この関数をうまく使う
Sub Sample2() Dim tmp As Variant, i As Long tmp = Split("123,田中,tanaka", ",") For i = LBound(tmp) To UBound(tmp) MsgBox tmp(i) Next i End Sub