von hansi26 » Mi, 12.03.2014 14:42
Dieses makro habe ich im Internet gefunden (6 aus 49). Kann man das eventuell umschreiben auf 5 aus 50????
http://www.herber.de/forum/archiv/236to ... ionen.html
Sub Lotto_moegliche_Kombinationen()
Dim i As Byte, j As Byte, k As Byte, l As Byte, m As Byte, n As Byte
Dim c As Integer, r As Long
r = 1
c = 1
Application.ScreenUpdating = False
For i = 1 To 49 For j = i + 1 To 49
For k = j + 1 To 49
For l = k + 1 To 49
For m = l + 1 To 49
For n = m + 1 To 49
Cells(r, c) = i & " " & j & " " & k & " " & l & " " & m & " " & n
r = r + 1
If r > 65536 Then
Application.ScreenUpdating = True
c = c + 1
r = 1
ThisWorkbook.Save
If c > 256 Then
c = 1
Worksheets.Add
End If
Application.ScreenUpdating = False
End If
Next
Next
Next
Next
Next
Next
End Sub
danke im Voraus
Hansi
Dieses makro habe ich im Internet gefunden (6 aus 49). Kann man das eventuell umschreiben auf 5 aus 50????
http://www.herber.de/forum/archiv/236to240/238072_Alle_LottoKombinationen.html
Sub Lotto_moegliche_Kombinationen()
Dim i As Byte, j As Byte, k As Byte, l As Byte, m As Byte, n As Byte
Dim c As Integer, r As Long
r = 1
c = 1
Application.ScreenUpdating = False
For i = 1 To 49 For j = i + 1 To 49
For k = j + 1 To 49
For l = k + 1 To 49
For m = l + 1 To 49
For n = m + 1 To 49
Cells(r, c) = i & " " & j & " " & k & " " & l & " " & m & " " & n
r = r + 1
If r > 65536 Then
Application.ScreenUpdating = True
c = c + 1
r = 1
ThisWorkbook.Save
If c > 256 Then
c = 1
Worksheets.Add
End If
Application.ScreenUpdating = False
End If
Next
Next
Next
Next
Next
Next
End Sub
danke im Voraus
Hansi