Private Sub CommandButton1_Click()
Dim Prec()
ReDim Prec(0 To 3)
With ListBox1
If .ListCount = 0 Or .ListIndex = -1 Or .ListIndex = 0 Then Exit Sub
For i = 0 To 3
Prec(i) = .List(.ListIndex - 1, i)
.List(.ListIndex - 1, i) = .List(.ListIndex, i)
.List(.ListIndex, i) = Prec(i)
Next
' Resélection de l'élément déplacé
.ListIndex = .ListIndex - 1
End With
End Sub
Private Sub CommandButton2_Click()
Dim Suiv()
ReDim Suiv(0 To 3)
With ListBox1
If .ListCount = 0 Then Exit Sub
For i = 0 To 3
Suiv(i) = .List(.ListIndex + 1, i)
.List(.ListIndex + 1, i) = .List(.ListIndex, i)
.List(.ListIndex, i) = Suiv(i)
Next
' Resélection de l'élément déplacé
.ListIndex = .ListIndex + 1
End With
End Sub