谢谢楼上的朋友热心帮忙~现在我连续试了很多次,是没有重复了~
谢谢楼上朋友的帮忙!
另外请教高手朋友红色字部分的意思是怎么理解?谢谢!
Private Sub Command1_Click()
Dim t1, t2 As Integer
Dim t3 As String
Dim t(9) As String
For t1 = 0 To 9
Randomize
t2 = Int((100 - 1 + 1) * Rnd + 1)
List1.AddItem abc(CStr(t2), t)
Next t1
End Sub
Private Function abc(a As String, b() As String) As String
Dim i As Integer
Dim bol As Boolean
bol = False
For i = LBound(b) To UBound(b)
If b(i) = a Then
bol = True
Exit For
End If
Next
If bol = False Then
abc = a
Else
Randomize
abc = abc(CStr(Int((100 - 1 + 1) * Rnd + 1)), b)
End If
End Function