Vba excel : code de suppression

Bonjour,
J'ai un soucis et je sollicite votre aide.
J'ai créé un formulaire vba pour remplir un tableau Excel. En cas d'erreur de remplissage, je peux récupérer et modifier les données à partir du formulaire. J'aimerais pouvoir sélectionner toute la ligne et la supprimer si besoin était. Malheureusement, je ne connais pas comment faire. Quelqu'un peut-il m'aider ?
Voici mon code pour récupérer et modifier les données :

Private Sub ButtonModifier_Click()
Dim plage As Range
Dim Cell As Range
Dim Dernligne As Long
Dim L As Long
Dim coderech As String
Dernligne = Sheets("Visiteurs").Range("A" & Rows.Count).End(xlUp).Row
If OptionButton1 = True Then
coderech = ComboBox1.Value
With Sheets("Visiteurs")
Set plage = .Range("A8:A" & Dernligne)
For Each Cell In plage
If Cell.Value = coderech Then

.Cells(Cell.Row, 2).Value = TextBox1.Value
.Cells(Cell.Row, 3).Value = TextBox3.Value
.Cells(Cell.Row, 4).Value = TextBox4.Value
.Cells(Cell.Row, 6).Value = TextBox5.Value
.Cells(Cell.Row, 7).Value = TextBox6.Value

End If
Next Cell
End With
TextBox1.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
ComboBox1.Value = ""
MsgBox "modification effectuée"
End Sub

Configuration: Windows / Chrome 86.0.4240.198

1 réponse

  1. Bonjour,

    Sans le fichier et l'Userform, on n'pourra vous aider.

    Bien cordialement

    Will


    0