排序倒简单
我相信应该难不到楼主~~
也不罗嗦些了
我写了个生成7个随即数的代码
楼主可以参考下
dim ni,n2,n3,n4,n5,n6,n7 As Integer
On Error Resume Next
n1 = Int(9 * Rnd)
Do
n2 = Int(9 * Rnd)
Loop While n1 = n2
Do
n3 = Int(9 * Rnd)
Loop While n3 = n1 Or n3 = n2
Do
n4 = Int(9 * Rnd)
Loop While n4 = n1 Or n4 = n2 Or n4 = n3
Do
n5 = Int(9 * Rnd)
Loop While n5 = n1 Or n5 = n2 = n5 = n3 Or n5 = n4
Do
n6 = Int(9 * Rnd)
Loop While n6 = n1 Or n6 = n2 Or n6 = n3 Or n6 = n4 = n6 = n5
Do
n7 = Int(9 * Rnd)
Loop While n7 = n1 Or n7 = n2 Or n7 = n3 Or n7 = n4 Or n7 = n5 Or n7 = n6
For i = 0 To 9
Next i