bonjour
voici un code a adapter qui te permet de supprimer une ligne dans la feuille de AFEH a adapter a ton fichier.
'Suppression d'une ligne de données
Sub Supp()
Dim reponse As String
Dim premcel, cel
reponse = InputBox("Entrez le kilométrage de la ligne à Supprimer", "Information")
If reponse = "" Then Exit Sub
On Error GoTo FIN
With Range("B19:B" & Range("B65536").End(xlUp).Row)
Set cel = .Find(reponse, LookIn:=xlValues, LookAt:=xlWhole)
If Not cel Is Nothing Then
premcel = cel.Address
Do
If MsgBox("Confirmez-vous la suppression" & vbCr & "de la ligne avec le kilomérage: " & reponse & " ?", _
vbYesNo + vbCritical + vbDefaultButton2, "Suppression") = vbYes Then
'Range(cel.Address).EntireRow.ClearContents
Range(cel.Address).EntireRow.Delete
MsgBox ("Les Données avec le kilométrage: " & reponse & " sont effacées.")
End If
Set cel = .FindNext(cel)
Loop While Not cel Is Nothing And cel.Address <> premcel
End If
End With
Exit Sub
FIN: MsgBox "Les données avec le kilométrage: " & reponse & " n'existent plus, ou ont été supprimées!"
End Sub
cordialement