P
Paul Black
Hi everyone,
Is there any way that the code below can be condensed or shortened
please
It cycles through six number combinations and counts the total of ALL
the digits in each combination. So, combination 10,11,12,13,14,15 will
= 1+0+1+1+1+2+1+3+1+4+1+5 = 21.
The total of ALL the digits range from 11 to 70.
Her is the code :-
Option Explicit
Option Base 1
Sub Sum_Of_Digits()
Dim Start As Double
Start = Timer
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim F As Integer
Dim i As Integer
Dim nMinA As Integer
Dim nMaxF As Integer
Dim nType(70) As Double
Application.ScreenUpdating = False
Sheets("Results").Select
Range("B4").Select
nMinA = 1
nMaxF = 49
For i = 11 To 70
nType(i) = 0
Next i
For A = nMinA To nMaxF - 5
For B = A + 1 To nMaxF - 4
For C = B + 1 To nMaxF - 3
For D = C + 1 To nMaxF - 2
For E = D + 1 To nMaxF - 1
For F = E + 1 To nMaxF
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 1 Then nType(1) = nType(1)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 2 Then nType(2) = nType(2)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 3 Then nType(3) = nType(3)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 4 Then nType(4) = nType(4)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 5 Then nType(5) = nType(5)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 6 Then nType(6) = nType(6)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 7 Then nType(7) = nType(7)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 8 Then nType(8) = nType(8)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 9 Then nType(9) = nType(9)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 10 Then nType(10) =
nType(10) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 11 Then nType(11) =
nType(11) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 12 Then nType(12) =
nType(12) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 13 Then nType(13) =
nType(13) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 14 Then nType(14) =
nType(14) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 15 Then nType(15) =
nType(15) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 16 Then nType(16) =
nType(16) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 17 Then nType(17) =
nType(17) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 18 Then nType(18) =
nType(18) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 19 Then nType(19) =
nType(19) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 20 Then nType(20) =
nType(20) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 21 Then nType(21) =
nType(21) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 22 Then nType(22) =
nType(22) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 23 Then nType(23) =
nType(23) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 24 Then nType(24) =
nType(24) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 25 Then nType(25) =
nType(25) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 26 Then nType(26) =
nType(26) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 27 Then nType(27) =
nType(27) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 28 Then nType(28) =
nType(28) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 29 Then nType(29) =
nType(29) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 30 Then nType(30) =
nType(30) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 31 Then nType(31) =
nType(31) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 32 Then nType(32) =
nType(32) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 33 Then nType(33) =
nType(33) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 34 Then nType(34) =
nType(34) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 35 Then nType(35) =
nType(35) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 36 Then nType(36) =
nType(36) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 37 Then nType(37) =
nType(37) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 38 Then nType(38) =
nType(38) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 39 Then nType(39) =
nType(39) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 40 Then nType(40) =
nType(40) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 41 Then nType(41) =
nType(41) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 42 Then nType(42) =
nType(42) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 43 Then nType(43) =
nType(43) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 44 Then nType(44) =
nType(44) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 45 Then nType(45) =
nType(45) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 46 Then nType(46) =
nType(46) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 47 Then nType(47) =
nType(47) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 48 Then nType(48) =
nType(48) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 49 Then nType(49) =
nType(49) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 50 Then nType(50) =
nType(50) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 51 Then nType(51) =
nType(51) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 52 Then nType(52) =
nType(52) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 53 Then nType(53) =
nType(53) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 54 Then nType(54) =
nType(54) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 55 Then nType(55) =
nType(55) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 56 Then nType(56) =
nType(56) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 57 Then nType(57) =
nType(57) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 58 Then nType(58) =
nType(58) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 59 Then nType(59) =
nType(59) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 60 Then nType(60) =
nType(60) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 61 Then nType(61) =
nType(61) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 62 Then nType(62) =
nType(62) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 63 Then nType(63) =
nType(63) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 64 Then nType(64) =
nType(64) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 65 Then nType(65) =
nType(65) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 66 Then nType(66) =
nType(66) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 67 Then nType(67) =
nType(67) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 68 Then nType(68) =
nType(68) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 69 Then nType(69) =
nType(69) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 70 Then nType(70) =
nType(70) + 1
Next F
Next E
Next D
Next C
Next B
Next A
For i = 11 To 70
ActiveCell.Offset(0, 0).Value = "Sum Of Digits ="
ActiveCell.Offset(0, 1).Value = i
ActiveCell.Offset(0, 2).Value = nType(i)
ActiveCell.Offset(1, 0).Select
Next i
ActiveCell.Offset(0, 0).Value = "Total Combinations Produced"
ActiveCell.Offset(0, 2).Value = nType(1) + nType(2) + nType(3) _
+ nType(4) + nType(5) + nType(6) + nType(7) + nType(8) + nType(9)
_
+ nType(10) + nType(11) + nType(12) + nType(13) + nType(14) +
nType(15) _
+ nType(16) + nType(17) + nType(18) + nType(19) + nType(20) +
nType(21) _
+ nType(22) + nType(23) + nType(24) + nType(25) + nType(26) +
nType(27) _
+ nType(28) + nType(29) + nType(30) + nType(31) + nType(32) +
nType(33) _
+ nType(34) + nType(35) + nType(36) + nType(37) + nType(38) +
nType(39) _
+ nType(40) + nType(41) + nType(42) + nType(43) + nType(44) +
nType(45) _
+ nType(46) + nType(47) + nType(48) + nType(49) + nType(50) +
nType(51) _
+ nType(52) + nType(53) + nType(54) + nType(55) + nType(56) +
nType(57) _
+ nType(58) + nType(59) + nType(60) + nType(61) + nType(62) +
nType(63) _
+ nType(64) + nType(65) + nType(66) + nType(67) + nType(68) +
nType(69) _
+ nType(70)
ActiveCell.Offset(2, 0) = "This Program Took " & _
Format(((Timer - Start) / 24 / 60 / 60), "hh:mm:ss") & " To
Process"
Range("B68").Select
Application.ScreenUpdating = True
End Sub
Thanks in Advance.
All the Best.
Paul
Is there any way that the code below can be condensed or shortened
please
It cycles through six number combinations and counts the total of ALL
the digits in each combination. So, combination 10,11,12,13,14,15 will
= 1+0+1+1+1+2+1+3+1+4+1+5 = 21.
The total of ALL the digits range from 11 to 70.
Her is the code :-
Option Explicit
Option Base 1
Sub Sum_Of_Digits()
Dim Start As Double
Start = Timer
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Dim E As Integer
Dim F As Integer
Dim i As Integer
Dim nMinA As Integer
Dim nMaxF As Integer
Dim nType(70) As Double
Application.ScreenUpdating = False
Sheets("Results").Select
Range("B4").Select
nMinA = 1
nMaxF = 49
For i = 11 To 70
nType(i) = 0
Next i
For A = nMinA To nMaxF - 5
For B = A + 1 To nMaxF - 4
For C = B + 1 To nMaxF - 3
For D = C + 1 To nMaxF - 2
For E = D + 1 To nMaxF - 1
For F = E + 1 To nMaxF
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 1 Then nType(1) = nType(1)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 2 Then nType(2) = nType(2)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 3 Then nType(3) = nType(3)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 4 Then nType(4) = nType(4)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 5 Then nType(5) = nType(5)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 6 Then nType(6) = nType(6)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 7 Then nType(7) = nType(7)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 8 Then nType(8) = nType(8)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 9 Then nType(9) = nType(9)
+ 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 10 Then nType(10) =
nType(10) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 11 Then nType(11) =
nType(11) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 12 Then nType(12) =
nType(12) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 13 Then nType(13) =
nType(13) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 14 Then nType(14) =
nType(14) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 15 Then nType(15) =
nType(15) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 16 Then nType(16) =
nType(16) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 17 Then nType(17) =
nType(17) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 18 Then nType(18) =
nType(18) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 19 Then nType(19) =
nType(19) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 20 Then nType(20) =
nType(20) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 21 Then nType(21) =
nType(21) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 22 Then nType(22) =
nType(22) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 23 Then nType(23) =
nType(23) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 24 Then nType(24) =
nType(24) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 25 Then nType(25) =
nType(25) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 26 Then nType(26) =
nType(26) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 27 Then nType(27) =
nType(27) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 28 Then nType(28) =
nType(28) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 29 Then nType(29) =
nType(29) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 30 Then nType(30) =
nType(30) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 31 Then nType(31) =
nType(31) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 32 Then nType(32) =
nType(32) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 33 Then nType(33) =
nType(33) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 34 Then nType(34) =
nType(34) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 35 Then nType(35) =
nType(35) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 36 Then nType(36) =
nType(36) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 37 Then nType(37) =
nType(37) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 38 Then nType(38) =
nType(38) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 39 Then nType(39) =
nType(39) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 40 Then nType(40) =
nType(40) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 41 Then nType(41) =
nType(41) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 42 Then nType(42) =
nType(42) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 43 Then nType(43) =
nType(43) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 44 Then nType(44) =
nType(44) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 45 Then nType(45) =
nType(45) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 46 Then nType(46) =
nType(46) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 47 Then nType(47) =
nType(47) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 48 Then nType(48) =
nType(48) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 49 Then nType(49) =
nType(49) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 50 Then nType(50) =
nType(50) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 51 Then nType(51) =
nType(51) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 52 Then nType(52) =
nType(52) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 53 Then nType(53) =
nType(53) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 54 Then nType(54) =
nType(54) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 55 Then nType(55) =
nType(55) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 56 Then nType(56) =
nType(56) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 57 Then nType(57) =
nType(57) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 58 Then nType(58) =
nType(58) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 59 Then nType(59) =
nType(59) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 60 Then nType(60) =
nType(60) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 61 Then nType(61) =
nType(61) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 62 Then nType(62) =
nType(62) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 63 Then nType(63) =
nType(63) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 64 Then nType(64) =
nType(64) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 65 Then nType(65) =
nType(65) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 66 Then nType(66) =
nType(66) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 67 Then nType(67) =
nType(67) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 68 Then nType(68) =
nType(68) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 69 Then nType(69) =
nType(69) + 1
If A \ 10 + A Mod 10 + B \ 10 + B Mod 10 + C \ 10 + C Mod 10 + D \ 10
+ D Mod 10 _
+ E \ 10 + E Mod 10 + F \ 10 + F Mod 10 = 70 Then nType(70) =
nType(70) + 1
Next F
Next E
Next D
Next C
Next B
Next A
For i = 11 To 70
ActiveCell.Offset(0, 0).Value = "Sum Of Digits ="
ActiveCell.Offset(0, 1).Value = i
ActiveCell.Offset(0, 2).Value = nType(i)
ActiveCell.Offset(1, 0).Select
Next i
ActiveCell.Offset(0, 0).Value = "Total Combinations Produced"
ActiveCell.Offset(0, 2).Value = nType(1) + nType(2) + nType(3) _
+ nType(4) + nType(5) + nType(6) + nType(7) + nType(8) + nType(9)
_
+ nType(10) + nType(11) + nType(12) + nType(13) + nType(14) +
nType(15) _
+ nType(16) + nType(17) + nType(18) + nType(19) + nType(20) +
nType(21) _
+ nType(22) + nType(23) + nType(24) + nType(25) + nType(26) +
nType(27) _
+ nType(28) + nType(29) + nType(30) + nType(31) + nType(32) +
nType(33) _
+ nType(34) + nType(35) + nType(36) + nType(37) + nType(38) +
nType(39) _
+ nType(40) + nType(41) + nType(42) + nType(43) + nType(44) +
nType(45) _
+ nType(46) + nType(47) + nType(48) + nType(49) + nType(50) +
nType(51) _
+ nType(52) + nType(53) + nType(54) + nType(55) + nType(56) +
nType(57) _
+ nType(58) + nType(59) + nType(60) + nType(61) + nType(62) +
nType(63) _
+ nType(64) + nType(65) + nType(66) + nType(67) + nType(68) +
nType(69) _
+ nType(70)
ActiveCell.Offset(2, 0) = "This Program Took " & _
Format(((Timer - Start) / 24 / 60 / 60), "hh:mm:ss") & " To
Process"
Range("B68").Select
Application.ScreenUpdating = True
End Sub
Thanks in Advance.
All the Best.
Paul