从 text 中读数进入二维数组,老是类型不匹配,求大神指点,
Private Sub Command1_Click()Dim str1() As String
Dim str2() As String
Dim arr() As String
Dim rows As Integer
Dim i As Integer
Dim j As Integer
rows = Text2.Text
ReDim Preserve str1(rows) As String
str1(rows) = Split(Text1, Chr(13) + Chr(10))
ReDim arr(rows, 5) As String
For i = 0 To rows - 1
str2 = Split(str1(i), ",")
For j = 1 To 5
arr(i, j) = str2(j)
Print "arr(" & i & "," & j & ")=" & arr(i, j),
Next
Next
End Sub