bonjour,
une autre proposition
Sub Testpermut()
Dim Tbl()
Dim i As Long, ne As Long, j As Long
Dim Chaine As String
Chaine = InputBox("permutation : introduire la chaine de caractères ")
If Len(Chaine) > 9 Then
MsgBox "trop de caractères à permuter"
Exit Sub
End If
ne = Application.WorksheetFunction.Fact(Len(Chaine))
ReDim Tbl(1 To ne, 1 To Len(Chaine))
Permuter Chaine, "", Tbl, j
Columns(1).Clear
Range(Cells(1, 1), Cells(j, Len(Chaine))).Value = Tbl
End Sub
Sub Permuter(Chaine As String, Debut As String, Tbl(), j As Long)
Dim i As Long, texte As String
If Len(Chaine) = 1 Then
j = j + 1
texte = Debut & Chaine
For i = 1 To Len(texte)
Tbl(j, i) = Mid(texte, i, 1)
Next i
Else
For i = 1 To Len(Chaine)
Permuter Mid(Chaine, 2, Len(Chaine) - 1), Debut & Left(Chaine, 1), Tbl, j
Chaine = Mid(Chaine, 2, Len(Chaine) - 1) & Left(Chaine, 1)
Next
End If
End Sub