Dim A() As StringPrivate Sub Command1_Click()A() = Split(Text1.Text, "-", -1, vbTextCompare)'以“-”将字符串分割后存到一个以下标为0开始的数组里Dim i As IntegerFor i = 0 To UBound(A()) 'UBound(a())返回数组的最大下标LBound(A())返回最小下标Debug.Print A(i) '将结果打印到即时窗口Next iEnd Sub