Call TriNombre(Array(2,8.99,4, 99.51,10,8.97,25,99.3, 8.96,24,100,12))
Sub TriNombre(MesNombres)
Dim imax, i, j, k, bpermute ,cprovisoire, liste
Dim Tableau()
imax = 0
For i=0 to UBound(MesNombres)
imax = imax + 1
ReDim Preserve Tableau(imax)
Tableau(imax) = MesNombres(i)
Next
bpermute = True
Do While bpermute = True
bpermute = False
For j = 1 To imax - 1
If Tableau(j) > Tableau(j + 1) Then
cprovisoire = Tableau(j)
Tableau(j) = Tableau(j + 1)
Tableau(j + 1) = cprovisoire
bpermute = True
End If
Next
Loop
'Affichage des nombres triés
For k = 1 To imax
liste = liste & Tableau(k) &vbCrLf
If k = imax Then MsgBox liste,,"Résultat trié"
Next
End Sub