答案:Private Sub Command1_Click()
Dim b(1 To 3) As Long
For I = Val(Text1.Text) To Val(Text2.Text)
te = te & Format(I, "00") & ","
Next
For J = 1 To 3
t = Split(te, ",")
Randomize
A = Int(Rnd * UBound(t) + 0)
b(J) = t(A)
te = Replace(te, t(A) & ",", "")
Next
For I = 1 To 2
For J = I + 1 To 3
If b(I) > b(J) Then temp = b(I): b(I) = b(J): b(J) = temp
Next
Next
Text3.Text = b(1)
Text4.Text = b(2)
Text5.Text = b(3)
End Sub
其他:你可以先生成3个随机数,将他们排序,再赋值到文本框中