Bonsoir,
voici une proposition parmi tant d'autres :
Sub class_par_long_mots()
t = Array("XDUIUOPJ", "JQSM", "DK", "QSD", "G", "FGM", "NQGFR")
For i = UBound(t) - 1 To 0 Step -1
For j = UBound(t) To 0 Step -1
If Len(t(j)) < Len(t(i)) Then
temp = t(j)
t(j) = t(i)
t(i) = temp
End If
Next j
Next i
Range("a1").Resize(UBound(t) + 1) = Application.Transpose(t)
End Sub
On part du dernier élément (index J) que l'on compare avec l'élément d'avant (index I) et s'il est plus petit alors on inverse les deux éléments testés en passant par une variable de stockage temporaire.
Ensuite on affiche le résultat en colonne A.
@ bientôt
LouReeD