Re bonjour,
Remontez votre test en début de macro : et n'oubliez pas le exit sub sinon votre macro continue.
Edit GMB plus rapide ... Bonsoir GMB
Private Sub CommandButton1_Click() 'ici on tranfère les données des vins sélectionnés
If ListBox1.ListIndex = 0 Then
MsgBox "sélectionnez au moin 1 produit"
Exit Sub
End If
Dim wk As Worksheet
Set wk = Worksheets("base")
wk.[A17:G61].ClearContents
Ligne = 17
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
wk.Cells(Ligne, 1) = Me.ListBox1.List(i, 0)
wk.Cells(Ligne, 5) = Me.ListBox1.List(i, 2)
wk.Cells(Ligne, 3) = Me.ListBox1.List(i, 3)
wk.Cells(Ligne, 2) = Me.ListBox1.List(i, 1)
wk.Cells(Ligne, 7) = Me.ListBox1.List(i, 4)
Ligne = Ligne + 1
End If
Next i
wk.Select
wk.Protect
Unload Me
End Sub