sum digits= excel 2013

jack

Member
Hello, I need help in this macro is the following =
* Do not tamper with the macro just add the maximum and minimum values
In each digit from 0 to 9
** As it stands now the macro has not this limit,
* Thus need = need each digit has an even field put the maximum and minimum values
* Example 3 digit 8 = minimum 1 and maximum

Min1, max3 = 8
* Then in another column separate the formations of 5 digits
* In ascending order
ex
* 12279 = this corret this ascending order in a separate list
72219
22719

Sub fiveCombo2()
Dim arr As Variant, x As Long, y As Long, z As Long, col As Long
n1 = Cells(1, 7): n2 = Cells(2, 7): n3 = Cells(3, 7): n4 = Cells(4, 7): n5 = Cells(5, 7)
n6 = Cells(6, 7): n7 = Cells(7, 7): n8 = Cells(8, 7): n9 = Cells(9, 7): n10 = Cells(10, 7)
arr = Array(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10)
y = 2
col = 1
Application.ScreenUpdating = False
For x = 0 To 99999
myStr = Format(x, "00000")
f = True
For z = 0 To 9
If Len(Replace(myStr, z, "")) < (5 - arr(z)) Then f = False
Next z
If f Then
If y = 65536 Then
col = col + 1
y = 2
End If
Cells(y, col) = "'" & myStr
y = y + 1
End If
Next x
Application.ScreenUpdating = True
End Sub
 

jack

Member
Hello, ice !!!can you help me please in the structure of the program?
* Thus, I first define the amount of each of the 10 digits
* What are 0,1,2,3,4,5,6,7,8,9 = 10 are the digits,
* example
* I want the digit one (1) appears 3 times 4 times zero. The mean 9 twice
* etc.
* Tinue for a formçao lotereria 60/6
* Example = 01,11,25,39,51,59 = the digit one appeared 3 times the digit nine twice etc.
Objective = I choose the maximum and minimum amount of participation of each digit (0-9)
* In forming the combination of 6 numbers lotto 60/6 or simulate another.
* The guarantee of success. is set up within the maximum and minimum values ​​within each digit
* Separately from the initial digit and digit end of each number
 

Sidebar

Top