Private Sub Modifications_Click()
Reponse = MsgBox("Confirmez-vous la modification de ce robinet ?", _
vbYesNo, "Demande de modification")
If Reponse = vbYes Then
With WsT
rw = Application.Match(ComboBox7, .Columns(1), 0)
.Cells(rw, "B") = ComboBox1
.Cells(rw, "C") = TextBox1
.Cells(rw, "D") = TextBox2
.Cells(rw, "E") = ComboBox2
.Cells(rw, "F") = TextBox3
.Cells(rw, "G") = ComboBox3
.Cells(rw, "H") = TextBox4
.Cells(rw, "I") = TextBox5
.Cells(rw, "J") = ComboBox4
.Cells(rw, "K") = ComboBox5
.Cells(rw, "L") = ComboBox6
.Cells(rw, "M") = TextBox6
.Cells(rw, "N") = TextBox7
End With
Else
Unload Me
End If
For i = 1 To 7
Controls("ComboBox" & i) = ""
Next i
For i = 1 To 7
Controls("TextBox" & i) = ""
Next i
End Sub
Private Sub Supprimer_Click()
Reponse = MsgBox("Confirmez-vous la suppression de ce robinet ?", _
vbYesNo, "Demande de suppression")
Num = 2348
If Reponse = vbYes Then
With WsT
rw = Application.Match(ComboBox7, .Columns(1), 0)
.Rows(rw).EntireRow.Delete
derlig = .Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To derlig
.Cells(i, "O") = i + Num
.Cells(i, "A") = .Cells(i, "B") & "-" & i
Next i
.Cells(derlig, "A").EntireRow.Delete
End With
Else
Unload Me
End If
For i = 1 To 7
Controls("ComboBox" & i) = ""
Next i
For i = 1 To 7
Controls("TextBox" & i) = ""
Next i
End Sub