Hallo Jockl65
vielleicht hilft das:
Sub Zufall()
Dim Pool
Pool = Array(1, 2, 3, 4, 5, 6)
For i = 0 To 10
MsgBox Auswahl(Pool) & " (" & Join(Pool, ", ") & ")"
Next i
End Sub
Public Function Auswahl(Pool)
Dim str As String
If UBound(Pool) = 0 Then
Auswahl = Pool(0)
Pool = Array(1, 2, 3, 4, 5, 6)
Else
Auswahl = Pool(Int(UBound(Pool) * Rnd + 1))
str = Join(Pool, ",")
str = Replace(Replace(str, Auswahl & ",", ""), "," & Auswahl, "")
Pool = Split(str, ",")
End If
End Function
Grüße Lutz
|