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
* 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