Maybe you can use this...If I type 1234, excel with generate & permutate 24 sets of numbers like 1234,1243,1324,1342,1423,1432, 2134,2143, 2314,2341, 2413,2431,3124,3142,3214,3241,3412,3421,4123, 4132,4213,4231,4312,4321.
Is that possible to conduct in Excel ?
sure.
24 formulas like this will do the job
=MID(A1,1,1) & MID(A1,2,1) & MID(A1,3,1) & MID(A1,4,1)
=MID(A1,1,1) & MID(A1,2,1) & MID(A1,4,1) & MID(A1,3,1)
=MID(A1,1,1) & MID(A1,3,1) & MID(A1,2,1) & MID(A1,4,1)
=MID(A1,1,1) & MID(A1,3,1) & MID(A1,4,1) & MID(A1,2,1)
=MID(A1,1,1) & MID(A1,4,1) & MID(A1,2,1) & MID(A1,3,1)
=MID(A1,1,1) & MID(A1,4,1) & MID(A1,3,1) & MID(A1,2,1)
...
Its common that lists like this aren't needed and analysis is easier than listing.
What is the goal?
It's not my code.
You have to select cell A1 before you run the code.
Overflow will occur if numeric variables are declared to the wrong magnitude.Overflow message still appear
Dim xxx as Integer
Dim xxx as Long
Dim xxx as Double
OK. Here's a code of a type basically designed for something else, but run it as it stands and see if it's the sort of thing ...Anyone can help me to generate permutations for 4 digits number without repetition ?
Sub permutingsortofstuff()
Dim b(10 ^ 4) As Boolean, c() As Boolean
Dim u(1 To 10 ^ 3, 1 To 1)
Dim i&, g&, h&, q&
Randomize
For i = 1 To 10 ^ 4
g = 0: q = 0
ReDim c(9)
Do
x = Int(Rnd * 4 + 1)
If c(x) = False Then
g = g + 1
q = q & x
c(x) = True
End If
Loop Until g = 4
If b(q) = False Then
h = h + 1
u(h, 1) = q
b(q) = True
End If
Next i
Range("D1").Resize(h) = u
End Sub