Vorige Pagina About the Author

' Generates Potential Sub Series order 4 (Balanced)

' Tested with Office 365 under Windows 11

Sub MgcLns4()

Dim a1(16), a(16)

y = MsgBox("Blocked", vbExclamation, "MgcLns4")
End

Sheets("Klad1").Select

n9 = 1              'head line

For i1 = 1 To 16
    a1(i1) = i1 - 1
Next i1

For j1 = 1 To 16
a(1) = a1(j1)

For j2 = j1 + 1 To 16
a(2) = a1(j2)

For j3 = j2 + 1 To 16
a(3) = a1(j3)

p2 = a(2) + a(3)

a(4) = p2 - a(1)
If a(4) < 0 Or a(4) > 15 Then GoTo 30
If a(4) <= a(3) Then GoTo 30

s4 = a(1) + a(2) + a(3) + a(4)

n9 = n9 + 1
For i1 = 1 To 4
    Cells(n9, i1).Value = a(i1)
Next i1
Cells(n9, 5).Value = s4
Cells(n9, 6).Value = n9 - 1

30 Next j3
20 Next j2
10 Next j1

End

End Sub

Vorige Pagina About the Author