Hallo,
ok, ich seh da noch n paar Fragezeichen über Deinem Haupte schweben......ich mach Dir mal nen Bsp.:
Option Explicit
Public Sub Zufall()
Dim i As Integer, fFeld() As Integer, iTemp As Integer, iZ As Integer
Dim vntInput As Variant
vntInput = Application.InputBox(Prompt:="Herr Ober, bitte Zahlen...;-)", _
Title:="Zufallszahlen", Type:=1)
If vntInput <> False Then
ReDim fFeld(vntInput) As Integer
For i = 1 To vntInput
fFeld(i) = i
Next i
For i = vntInput To 1 Step -1
Randomize Timer
iZ = Int((i * Rnd) + 1)
iTemp = fFeld(iZ)
fFeld(iZ) = fFeld(i)
fFeld(i) = iTemp
Next i
For i = 1 To vntInput
Cells(i, 1).Value = fFeld(i)
Next i
End If
End Sub
Gruß,
|