Bonjour,
N'étant pas particulièrement anglophile, l'utilisation systématique de l'anglais me rebute quelque peu quand ce n'est pas indispensable... Je préfère donc repartir à 0 !
Sub TirageTri()
Dim nT(19, 0) As Integer, i%, j%, x%, ntx0$, ntx1$
'Préparation
For i = 1 To 100
ntx0 = ntx0 & ChrW(i + 32)
Next i
'Mélange
Randomize
For i = 1 To 100
x = Int(Len(ntx0) * Rnd + 1)
ntx1 = ntx1 & Mid(ntx0, x, 1)
ntx0 = Replace(ntx0, Mid(ntx0, x, 1), "")
Next i
'Tirage
For i = 0 To 19
x = Int(Len(ntx1) * Rnd + 1)
ntx0 = Mid(ntx1, x, 1)
nT(i, 0) = AscW(ntx0) - 32
ntx1 = Replace(ntx1, ntx0, "")
Next i
'Tri
For i = 0 To 18
For j = i + 1 To 19
If nT(j, 0) < nT(i, 0) Then
x = nT(j, 0): nT(j, 0) = nT(i, 0): nT(i, 0) = x
End If
Next j
Next i
'Affectation
ActiveSheet.Range("A1:A20").Value = nT
End Sub
Cordialement.