Gruppe
Allgemein
Problem
Wie kann ich die Werte in Spalte A in einem zweiten Tabellenblatt nach dem Zufallsprinzip auf 4 Spalten verteilen?
StandardModule: basMain
Sub Zufall()
Dim wks As Worksheet
Dim iCounter As Integer, iRow As Integer
Dim iCol As Integer, iAct As Integer
Application.ScreenUpdating = False
Set wks = Worksheets("Tabelle2")
Randomize
For iRow = 1 To 64
For iCol = 1 To 4
iAct = Int((Range("A1").Value * Rnd) + 2)
wks.Cells(iRow, iCol).Value = Cells(iAct, 1).Value
Rows(iAct).Delete
Next iCol
Next iRow
wks.Columns.AutoFit
wks.Select
Application.ScreenUpdating = True
End Sub