【发布时间】:2018-01-04 17:44:38
【问题描述】:
我正在创建一个用户表单,它可以在数组中获取尽可能多的输入。每次输入新值时,数组都会变大 进入第二个输入时,下标超出范围
Sub getFlow()
Do
thisFlow = UserForm4.TextBox1.Value
If Val(thisFlow) >= 0 Then
If isInitiated = True Then
ReDim Preserve flows(1 To UBound(flows) + 1)
Else
ReDim flows(1)
isInitiated = True
check = True
End If
flows(UBound(flows)) = thisFlow
UserForm4.TextBox1 = ""
With UserForm4.TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
Else
MsgBox "Value should be equal or greater than zero!"
End If
Exit Do
Loop
【问题讨论】: