Private Sub cmd_Supprimer_Click()
Dim REF As Long
If TextBox1 = "" Then
MsgBox " il faut sélectionner un salarié pour pouvoir le supprimier"
Exit Sub
Else
REF = TextBox1
End If
If MsgBox("Etes-vous sur de vouloir supprimer ce salarié ? ", vbYesNo + vbCritical, "suppression article") = vbYes Then
Set ws = Sheets("sheet13")
If Not IsError(Application.Match(REF, Sheets("sheet13").Range("A:A"), 0)) Then
ligne = Application.Match(REF, Sheets("sheet13").Range("A:A"), 0)
ws.Rows(ligne).EntireRow.Delete
Unload Me
MsgBox "Le salarié s'est correctement supprimé"
UserForm5.Show
End If
End If
End Sub