Private Sub CommandButtonSupp_Click() ' supprimer
Dim varReponse As String
'si pas de sélection quitte
If ComboBoxRef.ListIndex = -1 Then Exit Sub
varReponse = MsgBox("Effacer la fiche article?", vbYesNo, "Alerte")
'si réponse non quitte
If varReponse = vbNo Then Exit Sub
'si oui continue
With Worksheets("OUVRAGE").Range("az10:bi2000")
Set[COLOR="Red"] c [/COLOR]= .Find(ComboBoxRef, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
NomLBindex = UserFormArt.ComboBoxRef.ListIndex + 10 ' ligne de reference
With Sheets("article")
.Range("B" & NomLBindex & ":da" & NomLBindex).Delete
End With
Unload UserFormArt
UserForm4.Show
Do
UserFormArtSupp.Show
With UserFormArtSupp
ListBox1.AddItem c.Address(0, 0)
ListBox1.List(ListBox1.ListCount - 1, 2) = Worksheets("OUVRAGE").Cells(c.Row, 2)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End With
End If
End With
End Sub