Private Sub Command1_Click() Dim i As Long For i = 1 To 10 Debug.Print "第" & i & "组" getRndNum Next End Sub Sub getRndNum() Dim get_num(100) As Integer Dim lsNum(10) As String Dim aaa As Integer, k As Integer, i As Integer Randomize k = 0 Do While k < 10 aaa = Int(Rnd * 100) + 1 If get_num(aaa) <> 1 Then k = k + 1 get_num(aaa) = 1 lsNum(k) = aaa End If Loop Debug.Print Join(lsNum, ",") End Sub 这样算不算!