Sub Combos()
Dim Total As Integer
Dim N1 As Integer
Dim N2 As Integer, Sum2 As Integer
Dim N3 As Integer, Sum3 As Integer
Dim N4 As Integer, Sum4 As Integer
Dim N5 As Integer, Sum5 As Integer
Dim N6 As Integer
Dim iRow As Long
Total = 100
'Total = CInt(InputBox("Enter desired total", "Combos", 60))
If Total = 0 Then Exit Sub
iRow = 1
'For N6 = (Total + 15) \ 6 To 49
'For N6 = (Total + 15) \ 6 To 100
For N6 = Total \ 3 To 100
For N5 = 5 To N6 - 1
Sum5 = N5 + N6
For N4 = 4 To N5 - 1
'For N4 = 1 To N5 - 1
Sum4 = Sum5 + N4
'For N3 = 3 To N4 - 1
'Sum3 = Sum4 + N3
' For N2 = 2 To N3 - 1
' Sum2 = Sum3 + N2
'N1 = Total - Sum2
'If N1 < 1 Then Exit For
'If N1 < N2 Then
iRow = iRow + 1
'Cells(iRow, 1) = N1
'Cells(iRow, 2) = N2
'Cells(iRow, 3) = N3
Cells(iRow, 4) = N4
Cells(iRow, 5) = N5
Cells(iRow, 6) = N6
'End If
'Next N2
'Next N3
Next N4
Next N5
Next N6
MsgBox iRow & " combinations found.", vbInformation, "Combos"
End Sub
Sub Iteration()
Dim a, b, c, d, e, f, g, h, i, j As Integer
For a = 1 To 98
For b = 1 To 98
For c = 1 To 98
' For d = 0 To 100
'For e = 0 To 100
'For f = 0 To 100
'For g = 0 To 100
' For h = 0 To 100
If a + b + c = 100 Then
For i = 2 To 50
For j = 2 To 50
Cells(i, j) = a * b * c
Next j
Next i
End If
'Next h
' Next g
'Next f
' Next e
' Next d
Next c
Next b
Next a
End Sub