|
发表于 2006-5-17 21:50:00
|
显示全部楼层
我分析过,有点出入,本人已改正,不过很感谢大师提拨
Sub main()
Dim a() As Double, b(2) As Double, judge As Boolean
ReDim a(2) As Double
a(0) = 1: a(1) = 2: a(2) = 3
For i = 0 To 2
b(i) = InputBox("ÇëÊäÈëÊý", "", "")
judge = False
For j = 0 To UBound(a)
If b(i) = a(j) Then judge = True
If judge = True Then
Exit For
End If
Next
If judge = False Then
ReDim Preserve a(UBound(a) + 1)
a(UBound(a)) = b(i)
End If
Next
MsgBox judge
MsgBox UBound(a)
MsgBox a(UBound(a))
End Sub |
|