Sub PermutAlea
dim sSrc as string, sPrv as string, sCbl as string
dim l as long, lPos as long
sSrc= InputBox ("Mot à permuter ?", "PERMUTATION" )
do
sPrv= sSrc : sCbl= ""
randomize
for l= 1 to len (sSrc)
lPos= int (Rnd * len (sPrv)) + 1 'On pioche
sCbl= sCbl + mid(sPrv, lPos, 1) 'On ajoute la lettre
sPrv= left(sPrv, lPos-1) & mid(sPrv, lPos+1) 'On la supprime de la chaîne provisoire
next l
' Faire "annuler" dans la boîte de message pour sortir
if MsgBox (sCbl, 1, "Proposition pour " & sSrc) <> 1 then exit do
loop
End Sub